vibe-design-system 2.5.44 → 2.5.46
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>`);
|