vibe-design-system 2.8.30 → 2.8.31
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
|
@@ -1291,6 +1291,9 @@ function buildStoryFileContent(comp) {
|
|
|
1291
1291
|
const usageFromPages = findComponentUsageInPages(componentName, PROJECT_ROOT);
|
|
1292
1292
|
const { argLines: defaultArgLines, lucideImports, iconPropNames, needReact } = buildDefaultArgsForRequiredProps(effectiveProps, usageFromPages, componentName, source);
|
|
1293
1293
|
const useReactNodeChildrenRender = !omitChildren && hasChildrenPropReactNode(effectiveProps);
|
|
1294
|
+
// Any component with no extractable props: suppress children arg + simplify render.
|
|
1295
|
+
// Covers feature, page, and section-type components regardless of tier classification (e.g. HeroSection, Footer)
|
|
1296
|
+
const isNoPropsFeature = effectiveProps.length === 0;
|
|
1294
1297
|
|
|
1295
1298
|
// Skip story only if not a page and no export found
|
|
1296
1299
|
if (exportStyle === "unknown" && !isPage && (!source.includes("export") || !new RegExp(`\\b${componentName}\\b`).test(source))) {
|
|
@@ -1366,16 +1369,25 @@ function buildStoryFileContent(comp) {
|
|
|
1366
1369
|
const propsArg = argsFallback ? `{ ...args${argsFallback} }` : (useSafeWrapper ? "args" : "args");
|
|
1367
1370
|
const renderLine = useReactNodeChildrenRender
|
|
1368
1371
|
? ` render: (args) => React.createElement(React.Suspense, { fallback: null }, React.createElement(${RenderTarget}, { ...args, children: args.children || React.createElement('span', null, 'Example') })),`
|
|
1369
|
-
:
|
|
1370
|
-
|
|
1372
|
+
: isNoPropsFeature
|
|
1373
|
+
? ` render: () => React.createElement(React.Suspense, { fallback: null }, React.createElement(${RenderTarget})),`
|
|
1374
|
+
: ` render: ${argsParam} => React.createElement(React.Suspense, { fallback: null }, React.createElement(${RenderTarget}, ${propsArg})),`;
|
|
1375
|
+
const childrenArgLine = (label) => {
|
|
1376
|
+
if (isNoPropsFeature) return null; // Feature/page with no props: no children arg
|
|
1377
|
+
return !omitChildren && !useReactNodeChildrenRender ? ` children: ${JSON.stringify(label)},` : null;
|
|
1378
|
+
};
|
|
1371
1379
|
|
|
1372
1380
|
if (!variants.length) {
|
|
1373
1381
|
lines.push(`export const Default: Story = {`);
|
|
1374
1382
|
lines.push(renderLine);
|
|
1375
|
-
|
|
1376
|
-
if (childrenArgLine(componentName))
|
|
1377
|
-
for (const line of defaultArgLines)
|
|
1378
|
-
|
|
1383
|
+
const storyArgLines = [];
|
|
1384
|
+
if (childrenArgLine(componentName)) storyArgLines.push(childrenArgLine(componentName));
|
|
1385
|
+
for (const line of defaultArgLines) storyArgLines.push(line);
|
|
1386
|
+
if (storyArgLines.length > 0) {
|
|
1387
|
+
lines.push(` args: {`);
|
|
1388
|
+
for (const line of storyArgLines) lines.push(line);
|
|
1389
|
+
lines.push(` },`);
|
|
1390
|
+
}
|
|
1379
1391
|
lines.push(`};`);
|
|
1380
1392
|
} else {
|
|
1381
1393
|
const defaultVariant = variants[0];
|