@tpitre/story-ui 4.5.0 โ†’ 4.5.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"promptGenerator.d.ts","sourceRoot":"","sources":["../../story-generator/promptGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAI9D,OAAO,EAEL,eAAe,EACf,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAEvC;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,eAAe,EAAE,oBAAoB,CAAC;IACvF,kBAAkB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,mBAAmB,EAAE,GAAG,eAAe,CAcxG;AA0gBD;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,mBAAmB,EAAE,GAChC,OAAO,CAAC,MAAM,CAAC,CA4JjB;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,mBAAmB,EAAE,EACjC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAqB/B;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,EA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C,CAqMjB;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,mBAAmB,EAAE,EACjC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAqB/B;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,aAAa,EACrB,UAAU,EAAE,mBAAmB,EAAE,EACjC,OAAO,CAAC,EAAE,sBAAsB,GAC/B,OAAO,CAAC,MAAM,CAAC,CAwJjB;AA4ED;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAIzF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,aAAa,GAAG,gBAAgB,CAG9E;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,aAAa,EAAE,CAGxD"}
@@ -562,7 +562,18 @@ export async function buildClaudePrompt(userPrompt, config, components) {
562
562
  });
563
563
  });
564
564
  }
565
- // Icons and other specific imports should be handled through additionalImports or considerations
565
+ // Smart icon handling - allow design system icons, prohibit external libraries
566
+ const iconComponents = components.filter(c => c.name && typeof c.name === 'string' &&
567
+ (c.name.toLowerCase().includes('icon') || c.name === 'Icon' || c.name === 'v-icon' || c.name === 'mat-icon' || c.name === 'sl-icon'));
568
+ if (iconComponents.length > 0) {
569
+ // Design system has icon support - allow those, prohibit external libraries
570
+ const allowedIconNames = iconComponents.map(c => c.name).join(', ');
571
+ promptParts.push('', '๐Ÿ”ถ ICON USAGE RULES ๐Ÿ”ถ', `Your design system includes icon components: ${allowedIconNames}`, 'โœ… You MAY use these icon components from the Available components list', '๐Ÿšซ Do NOT import from external icon libraries:', ' - @tabler/icons-react, @tabler/icons', ' - react-icons, lucide-react, @heroicons/react', ' - @fortawesome/react-fontawesome, @phosphor-icons/react', ' - Any other external icon package', 'If you need icons beyond what the design system provides, use Unicode symbols (โ†’ โœ“ + ร—) or text labels instead.', '');
572
+ }
573
+ else {
574
+ // No icon components discovered - prohibit all icon imports
575
+ promptParts.push('', '๐Ÿ”ด ICON IMPORT RESTRICTION ๐Ÿ”ด', 'This design system does not include icon components in the available components list.', '๐Ÿšซ Do NOT import from ANY icon library:', ' - @tabler/icons-react, @tabler/icons', ' - react-icons, lucide-react, @heroicons/react', ' - @fortawesome/react-fontawesome, @phosphor-icons/react', ' - @mui/icons-material, @chakra-ui/icons', ' - Any other icon package', 'โœ… Instead, use:', ' - Unicode symbols: โ†’ โœ“ โœ— + โˆ’ ร— รท โ€ข โ˜… โ™ฆ โ–ถ โ—€ โ–ฒ โ–ผ', ' - Text labels: "Add", "Remove", "Edit", "Delete"', ' - Badge or Button components with text content', 'Icons are NOT in the available components list and WILL cause import errors.', '');
576
+ }
566
577
  // Reinforce NO children in args rule
567
578
  promptParts.push('', '๐Ÿ”ด CRITICAL REMINDER: NEVER use children in args ๐Ÿ”ด', 'Always use render functions for any layout or component composition.', '');
568
579
  // Determine framework from config for rules section
@@ -687,6 +698,18 @@ export async function buildFrameworkAwarePrompt(userPrompt, config, components,
687
698
  });
688
699
  });
689
700
  }
701
+ // Smart icon handling - allow design system icons, prohibit external libraries
702
+ const iconComponents = components.filter(c => c.name && typeof c.name === 'string' &&
703
+ (c.name.toLowerCase().includes('icon') || c.name === 'Icon' || c.name === 'v-icon' || c.name === 'mat-icon' || c.name === 'sl-icon'));
704
+ if (iconComponents.length > 0) {
705
+ // Design system has icon support - allow those, prohibit external libraries
706
+ const allowedIconNames = iconComponents.map(c => c.name).join(', ');
707
+ promptParts.push('', '๐Ÿ”ถ ICON USAGE RULES ๐Ÿ”ถ', `Your design system includes icon components: ${allowedIconNames}`, 'โœ… You MAY use these icon components from the Available components list', '๐Ÿšซ Do NOT import from external icon libraries:', ' - @tabler/icons-react, @tabler/icons', ' - react-icons, lucide-react, @heroicons/react', ' - @fortawesome/react-fontawesome, @phosphor-icons/react', ' - Any other external icon package', 'If you need icons beyond what the design system provides, use Unicode symbols (โ†’ โœ“ + ร—) or text labels instead.', '');
708
+ }
709
+ else {
710
+ // No icon components discovered - prohibit all icon imports
711
+ promptParts.push('', '๐Ÿ”ด ICON IMPORT RESTRICTION ๐Ÿ”ด', 'This design system does not include icon components in the available components list.', '๐Ÿšซ Do NOT import from ANY icon library:', ' - @tabler/icons-react, @tabler/icons', ' - react-icons, lucide-react, @heroicons/react', ' - @fortawesome/react-fontawesome, @phosphor-icons/react', ' - @mui/icons-material, @chakra-ui/icons', ' - Any other icon package', 'โœ… Instead, use:', ' - Unicode symbols: โ†’ โœ“ โœ— + โˆ’ ร— รท โ€ข โ˜… โ™ฆ โ–ถ โ—€ โ–ฒ โ–ผ', ' - Text labels: "Add", "Remove", "Edit", "Delete"', ' - Badge or Button components with text content', 'Icons are NOT in the available components list and WILL cause import errors.', '');
712
+ }
690
713
  // Add framework-specific rules
691
714
  const frameworkType = generated.framework.componentFramework;
692
715
  const frameworkRules = getFrameworkSpecificRules(frameworkType);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tpitre/story-ui",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
4
4
  "description": "AI-powered Storybook story generator with dynamic component discovery",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",