vibe-design-system 1.9.11 → 1.9.12
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
|
@@ -364,6 +364,12 @@ const COMPONENT_SUGGESTION_KEYWORDS = [
|
|
|
364
364
|
{ re: /\bstat\b/i, name: "Stat" },
|
|
365
365
|
{ re: /\bprice\b/i, name: "Pricing" },
|
|
366
366
|
{ re: /\bfeature\b/i, name: "Feature" },
|
|
367
|
+
{ re: /\bbutton\b/i, name: "Button" },
|
|
368
|
+
{ re: /\btag\b/i, name: "Tag" },
|
|
369
|
+
{ re: /\bchip\b/i, name: "Chip" },
|
|
370
|
+
{ re: /\btile\b/i, name: "Tile" },
|
|
371
|
+
{ re: /\bbanner\b/i, name: "Banner" },
|
|
372
|
+
{ re: /\bmodal\b/i, name: "Modal" },
|
|
367
373
|
];
|
|
368
374
|
|
|
369
375
|
function suggestNameFromPattern(pattern, index) {
|
|
@@ -391,6 +397,8 @@ function extractComponentSuggestions() {
|
|
|
391
397
|
while ((m = re.exec(content)) !== null) {
|
|
392
398
|
const raw = (m[1] ?? m[2] ?? "").trim().replace(/\s+/g, " ").trim();
|
|
393
399
|
if (!raw) continue;
|
|
400
|
+
const classCount = raw.split(/\s+/).filter(Boolean).length;
|
|
401
|
+
if (classCount < 3) continue;
|
|
394
402
|
if (!byPattern.has(raw)) {
|
|
395
403
|
const before = content.substring(0, m.index);
|
|
396
404
|
const lastOpen = before.lastIndexOf("<");
|
|
@@ -795,7 +795,7 @@ function writeComponentSuggestionsStory(componentSuggestions) {
|
|
|
795
795
|
" render: () => (",
|
|
796
796
|
" <div style={{ padding: 24, fontFamily: \"system-ui, sans-serif\" }}>",
|
|
797
797
|
" <h2 style={{ marginBottom: 16 }}>Repeated className patterns (component candidates)</h2>",
|
|
798
|
-
" <p style={{ color: \"#888\", marginBottom: 24 }}>
|
|
798
|
+
" <p style={{ color: \"#888\", marginBottom: 24 }}>Patterns with 3+ classes appearing 2+ times across src/pages. Consider extracting as components.</p>",
|
|
799
799
|
" <div style={{ display: \"flex\", flexDirection: \"column\", gap: 24 }}>",
|
|
800
800
|
" {suggestions.map((s, i) => (",
|
|
801
801
|
" <div key={i} style={{ border: \"1px solid #333\", borderRadius: 8, padding: 16, background: \"#111\" }}>",
|