vibe-design-system 2.8.49 → 2.8.50
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
|
@@ -677,7 +677,9 @@ function buildMultiDimensionStories(variantMap, renderLine, childrenArgLine, def
|
|
|
677
677
|
lines.push(` ${primaryDimension}: "${dimensions[primaryDimension].default || dimensions[primaryDimension].values[0]}",`);
|
|
678
678
|
}
|
|
679
679
|
lines.push(` ${dimName}: "${val}",`);
|
|
680
|
-
|
|
680
|
+
// For icon size use a short symbol; otherwise use component name
|
|
681
|
+
const childLabel = val === "icon" ? "\u2726" : componentName;
|
|
682
|
+
if (childrenArgLine(childLabel)) lines.push(childrenArgLine(childLabel));
|
|
681
683
|
for (const line of filteredArgLines) lines.push(line);
|
|
682
684
|
lines.push(` },`);
|
|
683
685
|
lines.push(`};`);
|
|
@@ -709,29 +711,51 @@ function buildMultiDimensionStories(variantMap, renderLine, childrenArgLine, def
|
|
|
709
711
|
const secondaryDim = secondaryDimensions.find((d) => dimensions[d] && dimensions[d].values.length >= 2);
|
|
710
712
|
|
|
711
713
|
lines.push(`export const AllVariants: Story = {`);
|
|
712
|
-
lines.push(`
|
|
713
|
-
lines.push(`
|
|
714
|
+
lines.push(` parameters: { layout: "padded" },`);
|
|
715
|
+
lines.push(` render: () => {`);
|
|
714
716
|
|
|
715
717
|
if (secondaryDim) {
|
|
716
718
|
const secondaryValues = dimensions[secondaryDim].values;
|
|
719
|
+
const colCount = secondaryValues.length;
|
|
720
|
+
|
|
721
|
+
// Style constants for the grid
|
|
722
|
+
lines.push(` const hdr: React.CSSProperties = { textAlign: "center", fontSize: 11, fontWeight: 600, color: "#6b7280", fontFamily: "monospace", textTransform: "uppercase", letterSpacing: "0.05em", padding: "0 4px" };`);
|
|
723
|
+
lines.push(` const lbl: React.CSSProperties = { fontSize: 12, fontWeight: 500, color: "#374151", fontFamily: "monospace" };`);
|
|
724
|
+
lines.push(` const cell: React.CSSProperties = { display: "flex", justifyContent: "center", alignItems: "center" };`);
|
|
725
|
+
lines.push(` return (`);
|
|
726
|
+
lines.push(` <div style={{ padding: 24 }}>`);
|
|
727
|
+
lines.push(` <div style={{ display: "grid", gridTemplateColumns: "100px repeat(${colCount}, minmax(80px, 1fr))", gap: "16px 12px", alignItems: "center" }}>`);
|
|
728
|
+
|
|
729
|
+
// Header row: empty corner + secondary dimension labels
|
|
730
|
+
lines.push(` <div />`);
|
|
731
|
+
for (const sVal of secondaryValues) {
|
|
732
|
+
lines.push(` <div style={hdr}>${sVal}</div>`);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
// Data rows: primary label + component cells
|
|
717
736
|
for (const pVal of primaryValues) {
|
|
718
|
-
lines.push(`
|
|
719
|
-
lines.push(` <span style={{ width: 90, fontSize: 12, color: "#888", fontFamily: "monospace" }}>${pVal}</span>`);
|
|
737
|
+
lines.push(` <div style={lbl}>${pVal}</div>`);
|
|
720
738
|
for (const sVal of secondaryValues) {
|
|
721
|
-
|
|
739
|
+
const childText = sVal === "icon" ? "\u2726" : componentName;
|
|
740
|
+
lines.push(` <div style={cell}><ComponentRef ${primaryDimension}="${pVal}" ${secondaryDim}="${sVal}">${childText}</ComponentRef></div>`);
|
|
722
741
|
}
|
|
723
|
-
lines.push(` </div>`);
|
|
724
742
|
}
|
|
743
|
+
|
|
744
|
+
lines.push(` </div>`);
|
|
745
|
+
lines.push(` </div>`);
|
|
746
|
+
lines.push(` );`);
|
|
725
747
|
} else {
|
|
726
|
-
|
|
748
|
+
// No secondary dimension — labeled flex layout
|
|
749
|
+
lines.push(` return (`);
|
|
750
|
+
lines.push(` <div style={{ display: "flex", flexWrap: "wrap", gap: 12, padding: 24, alignItems: "center" }}>`);
|
|
727
751
|
for (const val of primaryValues) {
|
|
728
|
-
lines.push(` <ComponentRef ${primaryDimension}="${val}">${
|
|
752
|
+
lines.push(` <ComponentRef ${primaryDimension}="${val}">${componentName}</ComponentRef>`);
|
|
729
753
|
}
|
|
730
754
|
lines.push(` </div>`);
|
|
755
|
+
lines.push(` );`);
|
|
731
756
|
}
|
|
732
757
|
|
|
733
|
-
lines.push(`
|
|
734
|
-
lines.push(` ),`);
|
|
758
|
+
lines.push(` },`);
|
|
735
759
|
lines.push(`};`);
|
|
736
760
|
}
|
|
737
761
|
|
|
@@ -1595,7 +1619,7 @@ function buildProfileRenderLine(profile, RenderTarget, argsFallback) {
|
|
|
1595
1619
|
*/
|
|
1596
1620
|
function buildProfileChildrenArgLine(profile) {
|
|
1597
1621
|
return (label) => {
|
|
1598
|
-
if (profile === "WRAPPER") return ` children: ${JSON.stringify(label)},`;
|
|
1622
|
+
if (profile === "WRAPPER" || profile === "VARIANT") return ` children: ${JSON.stringify(label)},`;
|
|
1599
1623
|
return null;
|
|
1600
1624
|
};
|
|
1601
1625
|
}
|
|
@@ -1697,6 +1721,8 @@ function buildStoryFileContent(comp) {
|
|
|
1697
1721
|
lines.push(` component: ComponentRef,`);
|
|
1698
1722
|
// SECTION: no props/args → autodocs tries to render React.lazy without Suspense → useRef crash
|
|
1699
1723
|
if (profile !== "SECTION") lines.push(` tags: ["autodocs"],`);
|
|
1724
|
+
// Center small components (VARIANT, WRAPPER, CONFIGURED, SAFE) to prevent vertical stretching
|
|
1725
|
+
if (profile !== "SECTION") lines.push(` parameters: { layout: "centered" },`);
|
|
1700
1726
|
|
|
1701
1727
|
// Build argTypes from extracted TypeScript props + icon-specific overrides
|
|
1702
1728
|
const argTypeEntries = [];
|