vibe-design-system 2.5.43 → 2.5.45
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
|
@@ -846,22 +846,18 @@ function detectExportStyle(source, componentName) {
|
|
|
846
846
|
function buildSpecialStories(componentName, variants) {
|
|
847
847
|
const lines = [];
|
|
848
848
|
|
|
849
|
-
// Button: show
|
|
849
|
+
// Button: show a simple UsedVariants story based on known variants (no JSON injection to avoid \\u escape issues in Storybook)
|
|
850
850
|
if (componentName === "Button") {
|
|
851
|
-
const
|
|
852
|
-
const
|
|
853
|
-
|
|
854
|
-
|
|
851
|
+
const vs = variants && variants.length ? variants : ["default", "secondary", "destructive", "outline"];
|
|
852
|
+
lines.push(`const BUTTON_VARIANTS = [${vs.map((v) => `"${v}"`).join(", ")}];`);
|
|
853
|
+
lines.push(`const BUTTON_SIZES = ["default", "sm", "lg"];`);
|
|
854
|
+
lines.push("");
|
|
855
855
|
lines.push(`export const UsedVariants: Story = {`);
|
|
856
856
|
lines.push(` render: () => (`);
|
|
857
857
|
lines.push(` <div style={{ display: "flex", flexWrap: "wrap", gap: 12 }}>`);
|
|
858
|
-
lines.push(` {
|
|
859
|
-
lines.push(` <ComponentRef
|
|
860
|
-
lines.push(`
|
|
861
|
-
lines.push(` variant={c.variant}`);
|
|
862
|
-
lines.push(` size={c.size}`);
|
|
863
|
-
lines.push(` >`);
|
|
864
|
-
lines.push(` {c.variant}{c.size !== "default" ? " · " + c.size : ""}`);
|
|
858
|
+
lines.push(` {BUTTON_VARIANTS.map((variant) => (`);
|
|
859
|
+
lines.push(` <ComponentRef key={variant} variant={variant}>`);
|
|
860
|
+
lines.push(` {variant}`);
|
|
865
861
|
lines.push(` </ComponentRef>`);
|
|
866
862
|
lines.push(` ))}`);
|
|
867
863
|
lines.push(` </div>`);
|
|
@@ -1521,10 +1517,10 @@ function main() {
|
|
|
1521
1517
|
}
|
|
1522
1518
|
|
|
1523
1519
|
for (const comp of components) {
|
|
1524
|
-
if (comp.group === "shadcn" || comp.group === "Uncategorized") continue;
|
|
1525
|
-
if (comp.group !== "Components") continue;
|
|
1526
|
-
|
|
1527
1520
|
const componentName = toSafeComponentName(comp.name, comp.file);
|
|
1521
|
+
// Şu ana kadar shadcn grubunu atlıyorduk; Button için istisna tanıyalım
|
|
1522
|
+
if ((comp.group === "shadcn" || comp.group === "Uncategorized") && componentName !== "Button") continue;
|
|
1523
|
+
if (comp.group !== "Components" && componentName !== "Button") continue;
|
|
1528
1524
|
if (onlyName && componentName !== onlyName) continue;
|
|
1529
1525
|
|
|
1530
1526
|
const storyFileName = `${componentName}.stories.tsx`;
|