vibe-design-system 2.8.71 → 2.8.72
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
|
@@ -4205,9 +4205,10 @@ function writeComponentInventoryStory(components, foundations) {
|
|
|
4205
4205
|
});
|
|
4206
4206
|
|
|
4207
4207
|
// ── STORY_IDS map: project components get embedded as story iframes ─────────
|
|
4208
|
-
//
|
|
4209
|
-
|
|
4210
|
-
|
|
4208
|
+
// Uses Storybook's sanitize logic: lowercase + replace non-alphanumeric with '-'
|
|
4209
|
+
// PascalCase names stay as one word ("AppHeader" → "appheader"), matching real IDs
|
|
4210
|
+
function toStoryId(category, pascalName) {
|
|
4211
|
+
return [category, pascalName].join('/')
|
|
4211
4212
|
.toLowerCase().replace(/[^a-z0-9/]+/g, '-').replace(/-*\/+/g, '-')
|
|
4212
4213
|
.replace(/-+/g, '-').replace(/^-|-$/g, '') + '--default';
|
|
4213
4214
|
}
|
|
@@ -4220,7 +4221,12 @@ function writeComponentInventoryStory(components, foundations) {
|
|
|
4220
4221
|
// Find the category for this component from categorized
|
|
4221
4222
|
const cat = Object.keys(categorized).find(c => categorized[c].some(x => x.name === comp.name));
|
|
4222
4223
|
if (!cat) return null;
|
|
4223
|
-
|
|
4224
|
+
// Use PascalCase identifier to match Storybook story title field (no hyphenation of PascalCase)
|
|
4225
|
+
const pascalId = toPascalLocal(comp.name);
|
|
4226
|
+
// Only include if a story file actually exists for this component
|
|
4227
|
+
const storyFile = path.join(STORIES_DIR, `${pascalId}.stories.tsx`);
|
|
4228
|
+
if (!fs.existsSync(storyFile)) return null; // no story → shape HTML fallback
|
|
4229
|
+
return ` ${JSON.stringify(comp.name)}: ${JSON.stringify(toStoryId(cat, pascalId))}`;
|
|
4224
4230
|
})
|
|
4225
4231
|
.filter(Boolean);
|
|
4226
4232
|
|