vibe-design-system 2.5.17 → 2.5.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/bin/init.js +3 -0
- package/package.json +1 -1
- package/vds-core-template/story-generator.mjs +15 -1
package/bin/init.js
CHANGED
|
@@ -49,6 +49,7 @@ export default config;
|
|
|
49
49
|
const STORYBOOK_PREVIEW_TS = `import type { Preview } from "@storybook/react";
|
|
50
50
|
import React from "react";
|
|
51
51
|
import { MemoryRouter } from "react-router-dom";
|
|
52
|
+
// Uygulamanızla aynı stiller için: index.css + kullandığınız diğer global CSS dosyalarını ekleyin (örn. "../src/App.css").
|
|
52
53
|
import "../src/index.css";
|
|
53
54
|
|
|
54
55
|
const withRouter = (Story: any) => {
|
|
@@ -94,6 +95,8 @@ Geliştirme kuralları:
|
|
|
94
95
|
- Variant'lar için cva() kullan
|
|
95
96
|
- Tailwind CSS kullan
|
|
96
97
|
- Named export veya default export — ikisi de çalışır
|
|
98
|
+
|
|
99
|
+
Storybook stilleri sayfalardan farklıysa: .storybook/preview.ts içinde uygulamanızın kullandığı tüm global CSS dosyalarını import edin (index.css dışında App.css, globals.css vb.).
|
|
97
100
|
`;
|
|
98
101
|
|
|
99
102
|
const WATCH_MJS = `#!/usr/bin/env node
|
package/package.json
CHANGED
|
@@ -445,6 +445,19 @@ function parsePropsFromSource(source) {
|
|
|
445
445
|
/** Default icon for LucideIcon prop when name is generic (icon, leftIcon, etc.). */
|
|
446
446
|
const LUCIDE_ICON_DEFAULT = "Star";
|
|
447
447
|
|
|
448
|
+
/** Yaygın required string prop isimleri için anlamlı varsayılan metin (component'in boş/Example yerine görünür render etmesi için). */
|
|
449
|
+
const DEFAULT_STRINGS_BY_PROP_NAME = {
|
|
450
|
+
eyebrow: "Label",
|
|
451
|
+
title: "Section title",
|
|
452
|
+
description: "Short description for the section.",
|
|
453
|
+
value: "100",
|
|
454
|
+
name: "Example",
|
|
455
|
+
heading: "Heading",
|
|
456
|
+
subtitle: "Subtitle text",
|
|
457
|
+
text: "Sample text",
|
|
458
|
+
label: "Label",
|
|
459
|
+
};
|
|
460
|
+
|
|
448
461
|
/** Build default args lines and lucide-react imports for required props (LucideIcon → icon component, X[] → example item). */
|
|
449
462
|
function buildDefaultArgsForRequiredProps(props) {
|
|
450
463
|
const argLines = [];
|
|
@@ -462,9 +475,10 @@ function buildDefaultArgsForRequiredProps(props) {
|
|
|
462
475
|
if (/string\s*\[\]/.test(type)) {
|
|
463
476
|
argLines.push(` ${name}: ["Example"],`);
|
|
464
477
|
} else {
|
|
465
|
-
// Object arrays ({ label, value } vb.) birçok component'te doğrudan child olarak render edilince hata verir; güvenli varsayılan boş dizi.
|
|
466
478
|
argLines.push(` ${name}: [],`);
|
|
467
479
|
}
|
|
480
|
+
} else if (/string/.test(type) && DEFAULT_STRINGS_BY_PROP_NAME[name] !== undefined) {
|
|
481
|
+
argLines.push(` ${name}: ${JSON.stringify(DEFAULT_STRINGS_BY_PROP_NAME[name])},`);
|
|
468
482
|
}
|
|
469
483
|
}
|
|
470
484
|
return { argLines, lucideImports: [...lucideImports] };
|