vibe-design-system 2.8.71 → 2.8.73
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
|
@@ -3918,7 +3918,7 @@ function buildInventoryPreviewHtml(compName, category, colorSwatches, tokens) {
|
|
|
3918
3918
|
if (/^(tabs|tab)$/.test(n)) {
|
|
3919
3919
|
return wrap(`<div style="width:85%;box-sizing:border-box"><div style="display:flex;background:${bg};border-radius:${rad}px;padding:3px;gap:2px"><div style="flex:1;background:${bg === "#f3f4f6" ? "#fff" : hex2(bg)};border-radius:${Math.max(rad-2,2)}px;padding:4px 0;font-size:10px;font-weight:600;color:${txt};text-align:center">Tab 1</div><div style="flex:1;padding:4px 0;font-size:10px;color:${txt};opacity:0.5;text-align:center">Tab 2</div><div style="flex:1;padding:4px 0;font-size:10px;color:${txt};opacity:0.5;text-align:center">Tab 3</div></div></div>`);
|
|
3920
3920
|
}
|
|
3921
|
-
if (/^(table|datatable)$/.test(n) || category === "Text and Data Display") {
|
|
3921
|
+
if (/^(table|datatable)$/.test(n) || (category === "Text and Data Display" && !/chart|sparkline/.test(n))) {
|
|
3922
3922
|
return wrap(`<div style="border:1px solid ${brd};border-radius:${rad}px;overflow:hidden;width:85%;box-sizing:border-box"><div style="display:flex;background:${hex2(bg)};border-bottom:1px solid ${brd};padding:4px 8px;gap:8px">${[1,1,1].map(()=>`<div style="flex:1;height:5px;background:${txt};opacity:0.3;border-radius:1px"></div>`).join("")}</div><div style="display:flex;background:${bg};padding:4px 8px;gap:8px">${[1,1,1].map(()=>`<div style="flex:1;height:5px;background:${txt};opacity:0.15;border-radius:1px"></div>`).join("")}</div><div style="display:flex;background:${bg};padding:4px 8px;gap:8px;opacity:0.7">${[1,1,1].map(()=>`<div style="flex:1;height:5px;background:${txt};opacity:0.15;border-radius:1px"></div>`).join("")}</div></div>`);
|
|
3923
3923
|
}
|
|
3924
3924
|
if (/^(sidebar|appsidebar)$/.test(n)) {
|
|
@@ -4189,11 +4189,17 @@ function writeComponentInventoryStory(components, foundations) {
|
|
|
4189
4189
|
});
|
|
4190
4190
|
|
|
4191
4191
|
// ── PREVIEWS map: only shadcn UI primitives (safe to render with no props) ──
|
|
4192
|
-
|
|
4192
|
+
// Components that need context providers or have no visible closed state — use shape HTML
|
|
4193
|
+
const PREVIEW_CONTEXT_SKIP = new Set(['toast', 'toaster', 'sonner', 'usetoast', 'alertdialog', 'hovercard']);
|
|
4194
|
+
// Container/text components that need children to be visible (renders text inside)
|
|
4195
|
+
const TEXT_CHILD_NAMES = new Set(['button','badge','toggle','label','link','chip','tag','pill','card','alert','marketstatscard']);
|
|
4193
4196
|
const previewEntries = components
|
|
4194
4197
|
.filter(comp => {
|
|
4195
4198
|
const info = importInfoMap[comp.name];
|
|
4196
|
-
|
|
4199
|
+
if (!info || info.skip || !info.isShadcn) return false;
|
|
4200
|
+
// Skip components that require context providers (Toast, Toaster, Sonner)
|
|
4201
|
+
if (PREVIEW_CONTEXT_SKIP.has(info.identifier.toLowerCase())) return false;
|
|
4202
|
+
return true;
|
|
4197
4203
|
})
|
|
4198
4204
|
.map(comp => {
|
|
4199
4205
|
const { identifier } = importInfoMap[comp.name];
|
|
@@ -4205,9 +4211,10 @@ function writeComponentInventoryStory(components, foundations) {
|
|
|
4205
4211
|
});
|
|
4206
4212
|
|
|
4207
4213
|
// ── STORY_IDS map: project components get embedded as story iframes ─────────
|
|
4208
|
-
//
|
|
4209
|
-
|
|
4210
|
-
|
|
4214
|
+
// Uses Storybook's sanitize logic: lowercase + replace non-alphanumeric with '-'
|
|
4215
|
+
// PascalCase names stay as one word ("AppHeader" → "appheader"), matching real IDs
|
|
4216
|
+
function toStoryId(category, pascalName) {
|
|
4217
|
+
return [category, pascalName].join('/')
|
|
4211
4218
|
.toLowerCase().replace(/[^a-z0-9/]+/g, '-').replace(/-*\/+/g, '-')
|
|
4212
4219
|
.replace(/-+/g, '-').replace(/^-|-$/g, '') + '--default';
|
|
4213
4220
|
}
|
|
@@ -4220,7 +4227,12 @@ function writeComponentInventoryStory(components, foundations) {
|
|
|
4220
4227
|
// Find the category for this component from categorized
|
|
4221
4228
|
const cat = Object.keys(categorized).find(c => categorized[c].some(x => x.name === comp.name));
|
|
4222
4229
|
if (!cat) return null;
|
|
4223
|
-
|
|
4230
|
+
// Use PascalCase identifier to match Storybook story title field (no hyphenation of PascalCase)
|
|
4231
|
+
const pascalId = toPascalLocal(comp.name);
|
|
4232
|
+
// Only include if a story file actually exists for this component
|
|
4233
|
+
const storyFile = path.join(STORIES_DIR, `${pascalId}.stories.tsx`);
|
|
4234
|
+
if (!fs.existsSync(storyFile)) return null; // no story → shape HTML fallback
|
|
4235
|
+
return ` ${JSON.stringify(comp.name)}: ${JSON.stringify(toStoryId(cat, pascalId))}`;
|
|
4224
4236
|
})
|
|
4225
4237
|
.filter(Boolean);
|
|
4226
4238
|
|