@nikkory/vibe-engine 4.0.0

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.
Files changed (333) hide show
  1. package/PUBLISH-GUIDE.md +250 -0
  2. package/README.md +1267 -0
  3. package/bin/vibe.js +22 -0
  4. package/dist/adapters/index.d.ts +19 -0
  5. package/dist/browser.d.ts +25 -0
  6. package/dist/browser.js +15083 -0
  7. package/dist/browser.mjs +15000 -0
  8. package/dist/cli/batch-command.d.ts +142 -0
  9. package/dist/cli/generate-command.d.ts +119 -0
  10. package/dist/cli/index.d.ts +34 -0
  11. package/dist/constants/ComponentTypes.d.ts +65 -0
  12. package/dist/constants/DesignSystems.d.ts +64 -0
  13. package/dist/constants/Frameworks.d.ts +71 -0
  14. package/dist/constants/Tiers.d.ts +72 -0
  15. package/dist/constants/index.d.ts +10 -0
  16. package/dist/converters/index.d.ts +12 -0
  17. package/dist/converters/section-converter.d.ts +176 -0
  18. package/dist/index.d.ts +58 -0
  19. package/dist/index.js +19819 -0
  20. package/dist/index.mjs +19496 -0
  21. package/dist/resolution/basic/groups-basic.d.ts +80 -0
  22. package/dist/resolution/basic/index.d.ts +21 -0
  23. package/dist/resolution/basic/intents-basic.d.ts +195 -0
  24. package/dist/resolution/basic/presets-basic.d.ts +96 -0
  25. package/dist/resolution/basic/resolver-basic.d.ts +127 -0
  26. package/dist/resolution/basic/shorthands-basic.d.ts +88 -0
  27. package/dist/resolution/core/groups-core.d.ts +160 -0
  28. package/dist/resolution/core/index.d.ts +21 -0
  29. package/dist/resolution/core/intents-core.d.ts +355 -0
  30. package/dist/resolution/core/presets-core.d.ts +160 -0
  31. package/dist/resolution/core/resolver-core.d.ts +207 -0
  32. package/dist/resolution/core/shorthands-core.d.ts +144 -0
  33. package/dist/resolution/core/types-core.d.ts +167 -0
  34. package/dist/resolution/debugger.d.ts +183 -0
  35. package/dist/resolution/demo.d.ts +57 -0
  36. package/dist/resolution/enterprise/index.d.ts +22 -0
  37. package/dist/resolution/enterprise/metrics.d.ts +152 -0
  38. package/dist/resolution/enterprise/resolver-enterprise.d.ts +108 -0
  39. package/dist/resolution/examples.d.ts +486 -0
  40. package/dist/resolution/groups/experience-group.d.ts +197 -0
  41. package/dist/resolution/groups/index.d.ts +196 -0
  42. package/dist/resolution/groups/layout-group.d.ts +192 -0
  43. package/dist/resolution/groups/motion-group.d.ts +127 -0
  44. package/dist/resolution/groups/visual-group.d.ts +146 -0
  45. package/dist/resolution/index.d.ts +41 -0
  46. package/dist/resolution/intents/button-intents.d.ts +231 -0
  47. package/dist/resolution/intents/card-intents.d.ts +177 -0
  48. package/dist/resolution/intents/feedback-intents.d.ts +222 -0
  49. package/dist/resolution/intents/index.d.ts +189 -0
  50. package/dist/resolution/intents/input-intents.d.ts +231 -0
  51. package/dist/resolution/intents/mood-modifiers.d.ts +154 -0
  52. package/dist/resolution/performance.d.ts +264 -0
  53. package/dist/resolution/presets/button-presets.d.ts +243 -0
  54. package/dist/resolution/presets/card-presets.d.ts +216 -0
  55. package/dist/resolution/presets/data-display-presets.d.ts +290 -0
  56. package/dist/resolution/presets/feedback-presets.d.ts +335 -0
  57. package/dist/resolution/presets/form-presets.d.ts +308 -0
  58. package/dist/resolution/presets/index.d.ts +22 -0
  59. package/dist/resolution/presets/input-presets.d.ts +207 -0
  60. package/dist/resolution/presets/nav-presets.d.ts +235 -0
  61. package/dist/resolution/presets/overlay-presets.d.ts +216 -0
  62. package/dist/resolution/presets/preset-registry.d.ts +212 -0
  63. package/dist/resolution/resolveProps.d.ts +235 -0
  64. package/dist/resolution/shorthand/feel-mappings.d.ts +140 -0
  65. package/dist/resolution/shorthand/index.d.ts +172 -0
  66. package/dist/resolution/shorthand/look-mappings.d.ts +107 -0
  67. package/dist/resolution/shorthand/spacing-mappings.d.ts +164 -0
  68. package/dist/resolution/shorthand/surface-mappings.d.ts +139 -0
  69. package/dist/resolution/standard/groups-standard.d.ts +98 -0
  70. package/dist/resolution/standard/index.d.ts +28 -0
  71. package/dist/resolution/standard/intents-standard.d.ts +232 -0
  72. package/dist/resolution/standard/presets-standard.d.ts +123 -0
  73. package/dist/resolution/standard/resolver-standard.d.ts +204 -0
  74. package/dist/resolution/standard/shorthands-standard.d.ts +98 -0
  75. package/dist/resolution/standard/validators.d.ts +141 -0
  76. package/dist/resolution/types.d.ts +461 -0
  77. package/dist/resolution/validators/factor24-validator.d.ts +418 -0
  78. package/dist/resolution/validators/index.d.ts +14 -0
  79. package/dist/scripts/generate-react-library.d.ts +15 -0
  80. package/dist/scripts/write-react-library.d.ts +18 -0
  81. package/dist/storage/cloud-sync.d.ts +182 -0
  82. package/dist/storage/index.d.ts +69 -0
  83. package/dist/storage/local-storage.d.ts +131 -0
  84. package/dist/storage/section-storage.d.ts +191 -0
  85. package/dist/styling/StyleGenerator.d.ts +76 -0
  86. package/dist/styling/TokenStyleResolver.d.ts +163 -0
  87. package/dist/styling/factor-migration.d.ts +192 -0
  88. package/dist/styling/factor-validators.d.ts +327 -0
  89. package/dist/styling/factors-1-6.d.ts +674 -0
  90. package/dist/styling/factors-12-16.d.ts +700 -0
  91. package/dist/styling/factors-17-24.d.ts +668 -0
  92. package/dist/styling/factors-all.d.ts +348 -0
  93. package/dist/styling/factors.d.ts +291 -0
  94. package/dist/styling/index.d.ts +31 -0
  95. package/dist/styling/types.d.ts +400 -0
  96. package/dist/tokens/schema.d.ts +486 -0
  97. package/dist/types/Option.d.ts +178 -0
  98. package/dist/types/Result.d.ts +148 -0
  99. package/dist/types/algorithm-engine.types.d.ts +298 -0
  100. package/dist/types/granularity/base.types.d.ts +268 -0
  101. package/dist/types/granularity/config.types.d.ts +177 -0
  102. package/dist/types/granularity/factors.types.d.ts +194 -0
  103. package/dist/types/granularity/index.d.ts +57 -0
  104. package/dist/types/granularity/slot.types.d.ts +128 -0
  105. package/dist/types/granularity/template.types.d.ts +179 -0
  106. package/dist/types/granularity-levels/atom.config.d.ts +151 -0
  107. package/dist/types/granularity-levels/component.config.d.ts +175 -0
  108. package/dist/types/granularity-levels/index.d.ts +47 -0
  109. package/dist/types/granularity-levels/layout.config.d.ts +278 -0
  110. package/dist/types/granularity-levels/page.config.d.ts +210 -0
  111. package/dist/types/granularity-levels/section.config.d.ts +188 -0
  112. package/dist/types/granularity-levels/template.config.d.ts +340 -0
  113. package/dist/types/index.d.ts +152 -0
  114. package/dist/types/section-slot.types.d.ts +169 -0
  115. package/dist/types/section-storage.types.d.ts +298 -0
  116. package/dist/types/section-template.types.d.ts +170 -0
  117. package/dist/types/section.types.d.ts +326 -0
  118. package/dist/ui-studio/ComponentGenerator.d.ts +219 -0
  119. package/dist/ui-studio/composition/FactorPropagator.d.ts +268 -0
  120. package/dist/ui-studio/composition/PageGenerator.d.ts +176 -0
  121. package/dist/ui-studio/composition/SectionGenerator.d.ts +312 -0
  122. package/dist/ui-studio/composition/SlotResolver.d.ts +295 -0
  123. package/dist/ui-studio/composition/section-orchestrator.d.ts +306 -0
  124. package/dist/ui-studio/granularity/FactorCascade.d.ts +328 -0
  125. package/dist/ui-studio/granularity/GranularityGenerator.d.ts +266 -0
  126. package/dist/ui-studio/granularity/RecursiveGenerator.d.ts +328 -0
  127. package/dist/ui-studio/index.d.ts +94 -0
  128. package/dist/ui-studio/matrix/ClassMapper.d.ts +128 -0
  129. package/dist/ui-studio/matrix/MatrixResolver.d.ts +203 -0
  130. package/dist/ui-studio/matrix/types.d.ts +96 -0
  131. package/dist/ui-studio/presets/IndustryDetector.d.ts +183 -0
  132. package/dist/ui-studio/presets/component-registry.d.ts +213 -0
  133. package/dist/ui-studio/presets/factor-registry.d.ts +364 -0
  134. package/dist/ui-studio/presets/granularity-registry.d.ts +252 -0
  135. package/dist/ui-studio/presets/index.d.ts +32 -0
  136. package/dist/ui-studio/presets/industries.d.ts +143 -0
  137. package/dist/ui-studio/presets/layout-registry.d.ts +21 -0
  138. package/dist/ui-studio/presets/matrix-groups.d.ts +195 -0
  139. package/dist/ui-studio/presets/page-registry.d.ts +24 -0
  140. package/dist/ui-studio/presets/registry.constants.d.ts +69 -0
  141. package/dist/ui-studio/presets/registry.types.d.ts +166 -0
  142. package/dist/ui-studio/presets/section-defaults.d.ts +175 -0
  143. package/dist/ui-studio/presets/section-registry.d.ts +83 -0
  144. package/dist/ui-studio/presets/section-registry.defaults.d.ts +106 -0
  145. package/dist/ui-studio/presets/section-registry.helpers.d.ts +112 -0
  146. package/dist/ui-studio/presets/section-registry.types.d.ts +181 -0
  147. package/dist/ui-studio/presets/template-registry.d.ts +23 -0
  148. package/dist/ui-studio/presets/variants.d.ts +1038 -0
  149. package/dist/ui-studio/registries/components-registry.d.ts +193 -0
  150. package/dist/ui-studio/registries/design-systems-registry.d.ts +153 -0
  151. package/dist/ui-studio/registries/factors-registry.d.ts +145 -0
  152. package/dist/ui-studio/registries/tiers-registry.d.ts +150 -0
  153. package/dist/ui-studio/resolution/FactorResolver.d.ts +201 -0
  154. package/dist/ui-studio/templates/TestGenerator.d.ts +55 -0
  155. package/dist/ui-studio/templates/TierGenerator.d.ts +153 -0
  156. package/dist/ui-studio/templates/TypesGenerator.d.ts +51 -0
  157. package/dist/ui-studio/types/granularity/base.types.d.ts +268 -0
  158. package/dist/ui-studio/types/granularity/config.types.d.ts +177 -0
  159. package/dist/ui-studio/types/granularity/factors.types.d.ts +194 -0
  160. package/dist/ui-studio/types/granularity/index.d.ts +57 -0
  161. package/dist/ui-studio/types/granularity/slot.types.d.ts +128 -0
  162. package/dist/ui-studio/types/granularity/template.types.d.ts +179 -0
  163. package/dist/ui-studio/types/granularity-levels/atom.config.d.ts +151 -0
  164. package/dist/ui-studio/types/granularity-levels/component.config.d.ts +175 -0
  165. package/dist/ui-studio/types/granularity-levels/index.d.ts +47 -0
  166. package/dist/ui-studio/types/granularity-levels/layout.config.d.ts +278 -0
  167. package/dist/ui-studio/types/granularity-levels/page.config.d.ts +210 -0
  168. package/dist/ui-studio/types/granularity-levels/section.config.d.ts +188 -0
  169. package/dist/ui-studio/types/granularity-levels/template.config.d.ts +340 -0
  170. package/dist/ui-studio/types.d.ts +323 -0
  171. package/dist/utils/CodeUtils.d.ts +103 -0
  172. package/dist/utils/GenerateComponentValidator.d.ts +35 -0
  173. package/dist/utils/Logger.d.ts +101 -0
  174. package/dist/utils/StringUtils.d.ts +120 -0
  175. package/dist/utils/ValidationUtils.d.ts +71 -0
  176. package/dist/utils/errors/BaseError.d.ts +23 -0
  177. package/dist/utils/errors/GenerationError.d.ts +14 -0
  178. package/dist/utils/errors/TemplateNotFoundError.d.ts +13 -0
  179. package/dist/utils/errors/ValidationError.d.ts +13 -0
  180. package/dist/utils/errors/index.d.ts +12 -0
  181. package/dist/utils/factor-resolver.d.ts +294 -0
  182. package/dist/utils/granularity-helpers.d.ts +359 -0
  183. package/dist/utils/index.d.ts +20 -0
  184. package/dist/utils/performance.d.ts +26 -0
  185. package/dist/utils/stringify.d.ts +28 -0
  186. package/dist/validators/component-validator.d.ts +86 -0
  187. package/dist/validators/design-system-validator.d.ts +95 -0
  188. package/dist/validators/factor-validator.d.ts +101 -0
  189. package/dist/validators/index.d.ts +263 -0
  190. package/dist/validators/section-validator.d.ts +120 -0
  191. package/dist/validators/slot-validator.d.ts +161 -0
  192. package/dist/validators/tier-validator.d.ts +102 -0
  193. package/package.json +67 -0
  194. package/tests/16-factor-integration.test.d.ts +14 -0
  195. package/tests/16-factor-visual.test.d.ts +14 -0
  196. package/tests/5-level-integration.test.d.ts +14 -0
  197. package/tests/CodeUtils.test.d.ts +7 -0
  198. package/tests/DesignSystems.test.d.ts +7 -0
  199. package/tests/GenerateComponentValidator.test.d.ts +7 -0
  200. package/tests/Logger.test.d.ts +7 -0
  201. package/tests/StringUtils.test.d.ts +7 -0
  202. package/tests/StyleGenerator.test.d.ts +13 -0
  203. package/tests/Tiers.test.d.ts +7 -0
  204. package/tests/TokenRegistry.test.d.ts +14 -0
  205. package/tests/TokenStyleResolver.test.d.ts +13 -0
  206. package/tests/ValidationUtils.test.d.ts +7 -0
  207. package/tests/_pending_fix/Accordion.test.d.ts +13 -0
  208. package/tests/_pending_fix/Alert.test.d.ts +13 -0
  209. package/tests/_pending_fix/AlertDialog.test.d.ts +13 -0
  210. package/tests/_pending_fix/AspectRatio.test.d.ts +13 -0
  211. package/tests/_pending_fix/Autocomplete.test.d.ts +13 -0
  212. package/tests/_pending_fix/Avatar.test.d.ts +13 -0
  213. package/tests/_pending_fix/Badge.test.d.ts +13 -0
  214. package/tests/_pending_fix/Banner.test.d.ts +13 -0
  215. package/tests/_pending_fix/Box.test.d.ts +13 -0
  216. package/tests/_pending_fix/Breadcrumb.test.d.ts +13 -0
  217. package/tests/_pending_fix/Callout.test.d.ts +13 -0
  218. package/tests/_pending_fix/Card.test.d.ts +13 -0
  219. package/tests/_pending_fix/Center.test.d.ts +13 -0
  220. package/tests/_pending_fix/Checkbox.test.d.ts +13 -0
  221. package/tests/_pending_fix/Chip.test.d.ts +13 -0
  222. package/tests/_pending_fix/ColorPicker.test.d.ts +13 -0
  223. package/tests/_pending_fix/Combobox.test.d.ts +13 -0
  224. package/tests/_pending_fix/CommandPalette.test.d.ts +13 -0
  225. package/tests/_pending_fix/ConfirmationModal.test.d.ts +13 -0
  226. package/tests/_pending_fix/Container.test.d.ts +13 -0
  227. package/tests/_pending_fix/DataTable.test.d.ts +13 -0
  228. package/tests/_pending_fix/DatePicker.test.d.ts +13 -0
  229. package/tests/_pending_fix/DateRangePicker.test.d.ts +13 -0
  230. package/tests/_pending_fix/DateTimePicker.test.d.ts +13 -0
  231. package/tests/_pending_fix/Divider.test.d.ts +13 -0
  232. package/tests/_pending_fix/Drawer.test.d.ts +13 -0
  233. package/tests/_pending_fix/Dropdown.test.d.ts +13 -0
  234. package/tests/_pending_fix/EmptyState.test.d.ts +13 -0
  235. package/tests/_pending_fix/ErrorState.test.d.ts +13 -0
  236. package/tests/_pending_fix/FileDropzone.test.d.ts +13 -0
  237. package/tests/_pending_fix/FileUpload.test.d.ts +13 -0
  238. package/tests/_pending_fix/Flex.test.d.ts +13 -0
  239. package/tests/_pending_fix/Grid.test.d.ts +13 -0
  240. package/tests/_pending_fix/GridItem.test.d.ts +13 -0
  241. package/tests/_pending_fix/HStack.test.d.ts +13 -0
  242. package/tests/_pending_fix/Input.test.d.ts +13 -0
  243. package/tests/_pending_fix/InputCurrency.test.d.ts +13 -0
  244. package/tests/_pending_fix/InputGroup.test.d.ts +13 -0
  245. package/tests/_pending_fix/InputOTP.test.d.ts +13 -0
  246. package/tests/_pending_fix/InputPassword.test.d.ts +13 -0
  247. package/tests/_pending_fix/InputPhone.test.d.ts +13 -0
  248. package/tests/_pending_fix/InputSearch.test.d.ts +13 -0
  249. package/tests/_pending_fix/Link.test.d.ts +13 -0
  250. package/tests/_pending_fix/List.test.d.ts +13 -0
  251. package/tests/_pending_fix/LoadingOverlay.test.d.ts +13 -0
  252. package/tests/_pending_fix/Menu.test.d.ts +13 -0
  253. package/tests/_pending_fix/Modal.test.d.ts +13 -0
  254. package/tests/_pending_fix/MultiSelect.test.d.ts +13 -0
  255. package/tests/_pending_fix/NavGroup.test.d.ts +13 -0
  256. package/tests/_pending_fix/NavItem.test.d.ts +13 -0
  257. package/tests/_pending_fix/NavLink.test.d.ts +13 -0
  258. package/tests/_pending_fix/Navbar.test.d.ts +13 -0
  259. package/tests/_pending_fix/Notification.test.d.ts +13 -0
  260. package/tests/_pending_fix/NotificationBadge.test.d.ts +13 -0
  261. package/tests/_pending_fix/NumberInput.test.d.ts +13 -0
  262. package/tests/_pending_fix/Pagination.test.d.ts +13 -0
  263. package/tests/_pending_fix/Popover.test.d.ts +13 -0
  264. package/tests/_pending_fix/Progress.test.d.ts +13 -0
  265. package/tests/_pending_fix/ProgressCircle.test.d.ts +13 -0
  266. package/tests/_pending_fix/ProgressSteps.test.d.ts +13 -0
  267. package/tests/_pending_fix/Radio.test.d.ts +13 -0
  268. package/tests/_pending_fix/RangeSlider.test.d.ts +13 -0
  269. package/tests/_pending_fix/ResizablePanel.test.d.ts +13 -0
  270. package/tests/_pending_fix/ResultState.test.d.ts +13 -0
  271. package/tests/_pending_fix/ScrollArea.test.d.ts +13 -0
  272. package/tests/_pending_fix/Select.test.d.ts +14 -0
  273. package/tests/_pending_fix/Sheet.test.d.ts +13 -0
  274. package/tests/_pending_fix/Sidebar.test.d.ts +13 -0
  275. package/tests/_pending_fix/SimpleGrid.test.d.ts +13 -0
  276. package/tests/_pending_fix/Skeleton.test.d.ts +13 -0
  277. package/tests/_pending_fix/Slider.test.d.ts +13 -0
  278. package/tests/_pending_fix/Spacer.test.d.ts +13 -0
  279. package/tests/_pending_fix/Spinner.test.d.ts +13 -0
  280. package/tests/_pending_fix/Stack.test.d.ts +13 -0
  281. package/tests/_pending_fix/Stat.test.d.ts +13 -0
  282. package/tests/_pending_fix/Stepper.test.d.ts +14 -0
  283. package/tests/_pending_fix/Switch.test.d.ts +13 -0
  284. package/tests/_pending_fix/Table.test.d.ts +13 -0
  285. package/tests/_pending_fix/Tabs.test.d.ts +13 -0
  286. package/tests/_pending_fix/Textarea.test.d.ts +13 -0
  287. package/tests/_pending_fix/Timeline.test.d.ts +13 -0
  288. package/tests/_pending_fix/Toast.test.d.ts +14 -0
  289. package/tests/_pending_fix/Tooltip.test.d.ts +14 -0
  290. package/tests/_pending_fix/VStack.test.d.ts +13 -0
  291. package/tests/alert.test.d.ts +13 -0
  292. package/tests/badge.test.d.ts +13 -0
  293. package/tests/benchmarks/factor-resolution.bench.d.ts +41 -0
  294. package/tests/button.test.d.ts +16 -0
  295. package/tests/card.test.d.ts +19 -0
  296. package/tests/checkbox.test.d.ts +13 -0
  297. package/tests/component-16-factor-types.test.d.ts +13 -0
  298. package/tests/component-5level-integration.test.d.ts +14 -0
  299. package/tests/component-registry-ui.test.d.ts +13 -0
  300. package/tests/e2e/16-factor-visual.test.d.ts +14 -0
  301. package/tests/edge-cases.test.d.ts +14 -0
  302. package/tests/factor-17-24-integration.test.d.ts +14 -0
  303. package/tests/factor-17-24-performance.test.d.ts +14 -0
  304. package/tests/factor-validators.test.d.ts +13 -0
  305. package/tests/factors-1-6.test.d.ts +13 -0
  306. package/tests/factors-12-16.test.d.ts +13 -0
  307. package/tests/factors-17-24.test.d.ts +21 -0
  308. package/tests/factors-all.test.d.ts +13 -0
  309. package/tests/factors-registry.test.d.ts +11 -0
  310. package/tests/factors.test.d.ts +13 -0
  311. package/tests/granularity-types.test.d.ts +18 -0
  312. package/tests/groups.test.d.ts +14 -0
  313. package/tests/input.test.d.ts +16 -0
  314. package/tests/intents.test.d.ts +14 -0
  315. package/tests/memory-leak.test.d.ts +14 -0
  316. package/tests/modal.test.d.ts +19 -0
  317. package/tests/presets.test.d.ts +14 -0
  318. package/tests/radio.test.d.ts +13 -0
  319. package/tests/resolution-intents.test.d.ts +13 -0
  320. package/tests/resolution-presets.test.d.ts +13 -0
  321. package/tests/resolveProps.test.d.ts +14 -0
  322. package/tests/section-integration.test.d.ts +16 -0
  323. package/tests/section-types.test.d.ts +11 -0
  324. package/tests/setup.d.ts +13 -0
  325. package/tests/shorthands.test.d.ts +14 -0
  326. package/tests/switch.test.d.ts +13 -0
  327. package/tests/tabs.test.d.ts +13 -0
  328. package/tests/tiers-registry.test.d.ts +11 -0
  329. package/tests/useComponentStyles.test.d.ts +11 -0
  330. package/tests/useFactors.test.d.ts +13 -0
  331. package/tests/validators-invalid-input.test.d.ts +13 -0
  332. package/tsup.config.d.ts +11 -0
  333. package/vitest.config.d.ts +3 -0
@@ -0,0 +1,128 @@
1
+ /**
2
+ * ClassMapper - Maps factor VALUES to Tailwind CSS classes
3
+ *
4
+ * **Role in Architecture**: Handles USER OVERRIDES (non-default values)
5
+ *
6
+ * This class complements design-systems-registry by providing value-specific mappings:
7
+ *
8
+ * - **Registry**: Stores DEFAULT values per design system
9
+ * - Example: Material Design Factor 2 (Size) = 'md' → 'h-10 px-6 text-sm'
10
+ *
11
+ * - **ClassMapper**: Maps ALL POSSIBLE VALUES to Tailwind classes
12
+ * - Example: Factor 2 (Size):
13
+ * - 'xs' → 'h-6 px-2 text-xs'
14
+ * - 'sm' → 'h-8 px-4 text-sm'
15
+ * - 'md' → 'h-10 px-6 text-sm'
16
+ * - 'lg' → 'h-12 px-8 text-base'
17
+ * - 'xl' → 'h-14 px-10 text-lg'
18
+ *
19
+ * **Implementation Status**: 3/24 factors (incremental)
20
+ *
21
+ * Part of the Matrix Multiplication system (Matrix 2 × Matrix 4).
22
+ * Maps resolved factor values to corresponding Tailwind CSS classes.
23
+ *
24
+ * @packageDocumentation
25
+ * @module matrix/class-mapper
26
+ * @category matrix
27
+ * @since 1.0.0
28
+ *
29
+ * Powered by Nikkory
30
+ */
31
+ import type { IClassMapper, FactorId, FactorValue } from './types';
32
+ /**
33
+ * ClassMapper - Maps factor values to Tailwind CSS classes
34
+ *
35
+ * This class implements Matrix 2 × Matrix 4 multiplication by:
36
+ * 1. Taking resolved factor values (from FACTOR_REGISTRY + overrides)
37
+ * 2. Mapping each value to its corresponding Tailwind class
38
+ * 3. Filtering based on factor applicability (Matrix 4)
39
+ *
40
+ * @category matrix
41
+ * @since 1.0.0
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * const mapper = new ClassMapper();
46
+ * const className = mapper.mapToClass(4, 'md'); // Factor 4 = borderRadius
47
+ * console.log(className); // → 'rounded-md'
48
+ * ```
49
+ *
50
+ * Powered by Nikkory
51
+ */
52
+ export declare class ClassMapper implements IClassMapper {
53
+ /**
54
+ * Map factor 4 (borderRadius) to Tailwind class
55
+ *
56
+ * @param value - Border radius value ('none', 'sm', 'md', 'lg', 'xl', '2xl', 'full')
57
+ * @returns Tailwind class string or null if not mapped
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * mapBorderRadius('md') // → 'rounded-md'
62
+ * mapBorderRadius('none') // → 'rounded-none'
63
+ * mapBorderRadius('full') // → 'rounded-full'
64
+ * ```
65
+ */
66
+ private mapBorderRadius;
67
+ /**
68
+ * Map factor 5 (shadowStyle) to Tailwind class
69
+ *
70
+ * @param value - Shadow style value ('none', 'sm', 'md', 'lg', 'xl', '2xl')
71
+ * @returns Tailwind class string or null if not mapped
72
+ *
73
+ * @example
74
+ * ```typescript
75
+ * mapShadowStyle('md') // → 'shadow-md'
76
+ * mapShadowStyle('none') // → 'shadow-none'
77
+ * mapShadowStyle('2xl') // → 'shadow-2xl'
78
+ * ```
79
+ */
80
+ private mapShadowStyle;
81
+ /**
82
+ * Map factor 17 (spacing) to Tailwind class
83
+ *
84
+ * @param value - Spacing value ('none', 'sm', 'md', 'lg', 'xl')
85
+ * @returns Tailwind class string or null if not mapped
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * mapSpacing('md') // → 'px-4 py-2'
90
+ * mapSpacing('none') // → 'p-0'
91
+ * mapSpacing('xl') // → 'px-8 py-4'
92
+ * ```
93
+ */
94
+ private mapSpacing;
95
+ /**
96
+ * Map factor value to Tailwind class
97
+ *
98
+ * This is the main entry point for the ClassMapper.
99
+ * It dispatches to the appropriate mapper function based on factor ID.
100
+ *
101
+ * @param factorId - Factor ID (1-24)
102
+ * @param value - Factor value from design system or override
103
+ * @returns Tailwind class string or null if not mapped
104
+ *
105
+ * @example
106
+ * ```typescript
107
+ * const mapper = new ClassMapper();
108
+ *
109
+ * // Factor 4 = borderRadius
110
+ * mapper.mapToClass(4, 'md'); // → 'rounded-md'
111
+ *
112
+ * // Factor 5 = shadowStyle
113
+ * mapper.mapToClass(5, 'lg'); // → 'shadow-lg'
114
+ *
115
+ * // Factor 17 = spacing
116
+ * mapper.mapToClass(17, 'sm'); // → 'px-2 py-1'
117
+ *
118
+ * // Unknown factor
119
+ * mapper.mapToClass(999, 'value'); // → null
120
+ * ```
121
+ */
122
+ mapToClass(factorId: FactorId, value: FactorValue): string | null;
123
+ }
124
+ /**
125
+ * Export ClassMapper for use in matrix-resolver
126
+ */
127
+ export { ClassMapper as default };
128
+ //# sourceMappingURL=ClassMapper.d.ts.map
@@ -0,0 +1,203 @@
1
+ /**
2
+ * MatrixResolver - Orchestrates matrix multiplication for code generation
3
+ *
4
+ * Formula: Component = Matrix1 × Matrix2 × Matrix3 × Matrix4 + Override
5
+ *
6
+ * This module implements the core matrix multiplication algorithm:
7
+ * - Matrix 1: Component → HTML Element (from COMPONENT_REGISTRY)
8
+ * - Matrix 2: Factor → Design System Default Value (from FACTOR_REGISTRY)
9
+ * - Matrix 3: Tier → React Patterns (basic/standard/enterprise)
10
+ * - Matrix 4: Factor Applicability (Component × 24 Factors)
11
+ *
12
+ * **Tailwind Class Resolution Strategy** (Hybrid Approach):
13
+ *
14
+ * This resolver uses a two-tier approach to avoid duplicate mappings:
15
+ *
16
+ * 1. **User Overrides** (factor.source === 'override'):
17
+ * → ClassMapper.mapToClass(factorId, value)
18
+ * → Supports ALL possible values (xs, sm, md, lg, xl, etc.)
19
+ * → Example: User sets size='lg' → 'h-12 px-8 text-base'
20
+ *
21
+ * 2. **Design System Defaults** (factor.source === 'default'):
22
+ * → design-systems-registry.getFactorValue(designSystem, factorId)
23
+ * → 288 pre-defined mappings (12 design systems × 24 factors)
24
+ * → Example: Material Design size default → 'h-10 px-6 text-sm'
25
+ *
26
+ * This approach achieves:
27
+ * - ✅ No duplicate mappings (each system handles its domain)
28
+ * - ✅ Easy updates (defaults in registry, value mappings in ClassMapper)
29
+ * - ✅ Extensibility (add new possible values without touching registry)
30
+ *
31
+ * @packageDocumentation
32
+ * @module matrix/matrix-resolver
33
+ * @category matrix
34
+ * @since 1.0.0
35
+ *
36
+ * Powered by Nikkory
37
+ */
38
+ import type { IMatrixResolver, MatrixResolverInput, ResolvedComponentConfig } from './types';
39
+ /**
40
+ * MatrixResolver - Orchestrates matrix multiplication for code generation
41
+ *
42
+ * @category matrix
43
+ * @since 1.0.0
44
+ *
45
+ * @example
46
+ * ```typescript
47
+ * const resolver = new MatrixResolver();
48
+ * const config = resolver.resolve({
49
+ * componentId: 'button',
50
+ * designSystem: 'material-design',
51
+ * tier: 'enterprise',
52
+ * factor24Config: { 4: 'lg', 5: 'md' }
53
+ * });
54
+ * console.log(config.componentName); // → 'ButtonMaterialDesignEnterprise'
55
+ * console.log(config.classNames); // → ['rounded-lg', 'shadow-md', ...]
56
+ * ```
57
+ *
58
+ * Powered by Nikkory
59
+ */
60
+ export declare class MatrixResolver implements IMatrixResolver {
61
+ private classMapper;
62
+ constructor();
63
+ /**
64
+ * Matrix 1: Component → HTML Element
65
+ * Source: COMPONENT_REGISTRY
66
+ *
67
+ * @param componentId - Component identifier (e.g., 'button', 'input')
68
+ * @returns Element type and category
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * resolveMatrix1('button') // → { elementType: 'button', category: 'Interactive' }
73
+ * resolveMatrix1('input') // → { elementType: 'input', category: 'Interactive' }
74
+ * resolveMatrix1('card') // → { elementType: 'div', category: 'Container' }
75
+ * ```
76
+ */
77
+ private resolveMatrix1;
78
+ /**
79
+ * Matrix 2: Factor → Design System Default Value
80
+ * Source: FACTOR_REGISTRY with user overrides
81
+ *
82
+ * @param designSystem - Design system identifier
83
+ * @param factor24Config - User overrides (dto.factor24Config)
84
+ * @returns Array of resolved factor values with sources
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * // No overrides
89
+ * resolveMatrix2('material-design', undefined)
90
+ * // → [{ factorId: 1, value: '#1976D2', source: 'default' }, ...]
91
+ *
92
+ * // With overrides
93
+ * resolveMatrix2('material-design', { 4: 'lg' })
94
+ * // → [
95
+ * // { factorId: 4, value: 'lg', source: 'override' },
96
+ * // { factorId: 1, value: '#1976D2', source: 'default' },
97
+ * // ...
98
+ * // ]
99
+ * ```
100
+ */
101
+ private resolveMatrix2;
102
+ /**
103
+ * Matrix 3: Tier → React Patterns
104
+ *
105
+ * Maps tier to corresponding React patterns (imports, wrappers, features).
106
+ *
107
+ * @param tier - Quality tier (basic/standard/enterprise)
108
+ * @returns React patterns for the tier
109
+ *
110
+ * @example
111
+ * ```typescript
112
+ * resolveMatrix3('basic')
113
+ * // → {
114
+ * // tier: 'basic',
115
+ * // imports: ["import * as React from 'react';"],
116
+ * // wrappers: ['React.FC'],
117
+ * // features: []
118
+ * // }
119
+ *
120
+ * resolveMatrix3('enterprise')
121
+ * // → {
122
+ * // tier: 'enterprise',
123
+ * // imports: ["import * as React from 'react';", ...],
124
+ * // wrappers: ['memo', 'forwardRef'],
125
+ * // features: ['displayName', 'analytics']
126
+ * // }
127
+ * ```
128
+ */
129
+ private resolveMatrix3;
130
+ /**
131
+ * Matrix 4: Factor Applicability (Component × Factor)
132
+ * Source: COMPONENT_REGISTRY.factorApplicability
133
+ *
134
+ * @param componentId - Component identifier
135
+ * @returns Applicable factor IDs for this component
136
+ *
137
+ * @example
138
+ * ```typescript
139
+ * resolveMatrix4('button')
140
+ * // → { applicableFactors: [1, 2, 3, 4, 6, 7, 8, ...] }
141
+ *
142
+ * resolveMatrix4('input')
143
+ * // → { applicableFactors: [1, 2, 3, 4, 7, 10, ...] }
144
+ * ```
145
+ */
146
+ private resolveMatrix4;
147
+ /**
148
+ * Format component name (PascalCase)
149
+ *
150
+ * @param componentId - Component identifier (kebab-case)
151
+ * @param designSystem - Design system identifier (kebab-case)
152
+ * @param tier - Quality tier
153
+ * @returns Formatted component name
154
+ *
155
+ * @example
156
+ * ```typescript
157
+ * formatComponentName('button', 'material-design', 'enterprise')
158
+ * // → 'ButtonMaterialDesignEnterprise'
159
+ *
160
+ * formatComponentName('radio-group', 'ios-hig', 'standard')
161
+ * // → 'RadioGroupIosHigStandard'
162
+ * ```
163
+ */
164
+ private formatComponentName;
165
+ /**
166
+ * Resolve complete component configuration using matrix multiplication
167
+ *
168
+ * Formula: Component = Matrix1 × Matrix2 × Matrix3 × Matrix4 + Override
169
+ *
170
+ * @param input - Matrix resolver input
171
+ * @returns Resolved component configuration ready for template generation
172
+ *
173
+ * @example
174
+ * ```typescript
175
+ * const resolver = new MatrixResolver();
176
+ *
177
+ * const config = resolver.resolve({
178
+ * componentId: 'button',
179
+ * designSystem: 'material-design',
180
+ * tier: 'enterprise',
181
+ * factor24Config: { 4: 'lg', 5: 'md' }
182
+ * });
183
+ *
184
+ * console.log(config);
185
+ * // {
186
+ * // componentName: 'ButtonMaterialDesignEnterprise',
187
+ * // elementType: 'button',
188
+ * // tier: 'enterprise',
189
+ * // designSystem: 'material-design',
190
+ * // classNames: ['rounded-lg', 'shadow-md', 'px-4', 'py-2', ...],
191
+ * // imports: ["import * as React from 'react';", ...],
192
+ * // wrappers: ['memo', 'forwardRef'],
193
+ * // features: ['displayName', 'analytics']
194
+ * // }
195
+ * ```
196
+ */
197
+ resolve(input: MatrixResolverInput): ResolvedComponentConfig;
198
+ }
199
+ /**
200
+ * Export MatrixResolver as default
201
+ */
202
+ export { MatrixResolver as default };
203
+ //# sourceMappingURL=MatrixResolver.d.ts.map
@@ -0,0 +1,96 @@
1
+ import type { DesignSystem, Tier } from '../types';
2
+ /**
3
+ * Factor ID (1-24)
4
+ * Source: packages/engine/src/registries/components-registry.ts:53-80
5
+ */
6
+ export type FactorId = number;
7
+ /**
8
+ * Factor value resolved from design system
9
+ */
10
+ export type FactorValue = string | number | boolean | null;
11
+ /**
12
+ * Factor configuration (24 factors)
13
+ * Key: factor ID, Value: user override or resolved value
14
+ */
15
+ export interface Factor24Config {
16
+ readonly [factorId: number]: FactorValue;
17
+ }
18
+ /**
19
+ * Matrix 1: Component → HTML Element
20
+ * Source: packages/engine/src/registries/components-registry.ts
21
+ */
22
+ export interface Matrix1Result {
23
+ readonly elementType: string;
24
+ readonly category: string;
25
+ }
26
+ /**
27
+ * Matrix 2: Factor → Design System Default Value
28
+ * Source: packages/engine/src/presets/factor-registry.ts
29
+ */
30
+ export interface Matrix2Result {
31
+ readonly factorId: FactorId;
32
+ readonly value: FactorValue;
33
+ readonly source: 'override' | 'parent' | 'default';
34
+ }
35
+ /**
36
+ * Matrix 3: Tier → React Patterns
37
+ */
38
+ export interface Matrix3Result {
39
+ readonly tier: Tier;
40
+ readonly imports: readonly string[];
41
+ readonly wrappers: readonly string[];
42
+ readonly features: readonly string[];
43
+ }
44
+ /**
45
+ * Matrix 4: Factor Applicability (Component × Factor)
46
+ * Source: packages/engine/src/registries/components-registry.ts
47
+ */
48
+ export interface Matrix4Result {
49
+ readonly applicableFactors: readonly FactorId[];
50
+ }
51
+ /**
52
+ * Final resolved component configuration
53
+ */
54
+ export interface ResolvedComponentConfig {
55
+ readonly componentName: string;
56
+ readonly elementType: string;
57
+ readonly tier: Tier;
58
+ readonly designSystem: DesignSystem;
59
+ readonly classNames: readonly string[];
60
+ readonly imports: readonly string[];
61
+ readonly wrappers: readonly string[];
62
+ readonly features: readonly string[];
63
+ }
64
+ /**
65
+ * Class mapper interface
66
+ */
67
+ export interface IClassMapper {
68
+ /**
69
+ * Map factor value to Tailwind class
70
+ * @param factorId - Factor ID (1-24)
71
+ * @param value - Factor value
72
+ * @returns Tailwind class string or null if not applicable
73
+ */
74
+ mapToClass(factorId: FactorId, value: FactorValue): string | null;
75
+ }
76
+ /**
77
+ * Matrix resolver interface
78
+ */
79
+ export interface IMatrixResolver {
80
+ /**
81
+ * Resolve component configuration using matrix multiplication
82
+ * @param input - Input parameters
83
+ * @returns Resolved component configuration
84
+ */
85
+ resolve(input: MatrixResolverInput): ResolvedComponentConfig;
86
+ }
87
+ /**
88
+ * Matrix resolver input
89
+ */
90
+ export interface MatrixResolverInput {
91
+ readonly componentId: string;
92
+ readonly designSystem: DesignSystem;
93
+ readonly tier: Tier;
94
+ readonly factor24Config?: Factor24Config;
95
+ }
96
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,183 @@
1
+ /**
2
+ * Industry Detector
3
+ *
4
+ * Detects industry from user input using keyword matching and scoring.
5
+ * Provides intelligent industry detection for automatic preset recommendations.
6
+ *
7
+ * @packageDocumentation
8
+ * @module presets/IndustryDetector
9
+ * @since 2.0.0
10
+ *
11
+ * Powered by Nikkory
12
+ */
13
+ import { type IndustryPreset, type IndustryCategory, type DesignSystemId } from './industries';
14
+ import { type MatrixGroup } from './matrix-groups';
15
+ /**
16
+ * Detection confidence levels.
17
+ */
18
+ export type DetectionConfidence = 'high' | 'medium' | 'low' | 'none';
19
+ /**
20
+ * Detection result with confidence scoring.
21
+ */
22
+ export interface DetectionResult {
23
+ /** Detected industry preset */
24
+ readonly preset: IndustryPreset | null;
25
+ /** Confidence level */
26
+ readonly confidence: DetectionConfidence;
27
+ /** Numeric confidence score (0-100) */
28
+ readonly score: number;
29
+ /** Matched keywords */
30
+ readonly matchedKeywords: readonly string[];
31
+ /** Alternative industry matches */
32
+ readonly alternatives: readonly AlternativeMatch[];
33
+ }
34
+ /**
35
+ * Alternative industry match.
36
+ */
37
+ export interface AlternativeMatch {
38
+ /** Industry preset */
39
+ readonly preset: IndustryPreset;
40
+ /** Confidence score */
41
+ readonly score: number;
42
+ /** Matched keywords */
43
+ readonly matchedKeywords: readonly string[];
44
+ }
45
+ /**
46
+ * Industry recommendation with components.
47
+ */
48
+ export interface IndustryRecommendation {
49
+ /** Industry preset */
50
+ readonly industry: IndustryPreset;
51
+ /** Recommended matrix groups */
52
+ readonly matrixGroups: readonly MatrixGroup[];
53
+ /** Recommended design systems (ordered by priority) */
54
+ readonly designSystems: readonly DesignSystemId[];
55
+ /** Priority components for this industry */
56
+ readonly priorityComponents: readonly string[];
57
+ /** Estimated bundle size in KB */
58
+ readonly estimatedBundleSize: number;
59
+ }
60
+ /**
61
+ * Detect industry from user input text.
62
+ *
63
+ * Uses keyword matching and scoring to find the best matching industry preset.
64
+ *
65
+ * @param input - User input text to analyze
66
+ * @returns Detection result with confidence scoring
67
+ *
68
+ * @example
69
+ * ```typescript
70
+ * const result = detectIndustry("I'm building a banking app for payments");
71
+ * // Returns: { preset: financePreset, confidence: 'high', score: 85, ... }
72
+ * ```
73
+ */
74
+ export declare function detectIndustry(input: string): DetectionResult;
75
+ /**
76
+ * Detect multiple industries from input (for mixed-use cases).
77
+ *
78
+ * @param input - User input text
79
+ * @param maxResults - Maximum number of results (default: 3)
80
+ * @returns Array of detected industries
81
+ */
82
+ export declare function detectMultipleIndustries(input: string, maxResults?: number): DetectionResult[];
83
+ /**
84
+ * Get full industry recommendation with components and design systems.
85
+ *
86
+ * @param industryId - Industry ID or detected industry
87
+ * @returns Complete recommendation or null if not found
88
+ *
89
+ * @example
90
+ * ```typescript
91
+ * const recommendation = getIndustryRecommendation('finance');
92
+ * // Returns: { industry, matrixGroups, designSystems, priorityComponents, ... }
93
+ * ```
94
+ */
95
+ export declare function getIndustryRecommendation(industryId: string): IndustryRecommendation | null;
96
+ /**
97
+ * Get recommendation from user input (combines detection + recommendation).
98
+ *
99
+ * @param input - User input text
100
+ * @returns Industry recommendation or null if no match
101
+ *
102
+ * @example
103
+ * ```typescript
104
+ * const rec = getRecommendationFromInput("building a fintech app");
105
+ * // Returns recommendation for finance industry
106
+ * ```
107
+ */
108
+ export declare function getRecommendationFromInput(input: string): IndustryRecommendation | null;
109
+ /**
110
+ * Get all available industry IDs.
111
+ */
112
+ export declare function getAvailableIndustries(): string[];
113
+ /**
114
+ * Get industry preset by ID.
115
+ */
116
+ export declare function getIndustryPreset(id: string): IndustryPreset | undefined;
117
+ /**
118
+ * Get industries by category.
119
+ */
120
+ export declare function getIndustriesByCategory(category: IndustryCategory): IndustryPreset[];
121
+ /**
122
+ * Search industries by keyword.
123
+ *
124
+ * @param keyword - Search keyword
125
+ * @returns Matching industries
126
+ */
127
+ export declare function searchIndustries(keyword: string): IndustryPreset[];
128
+ /**
129
+ * Validate if an industry ID exists.
130
+ */
131
+ export declare function isValidIndustry(id: string): boolean;
132
+ /**
133
+ * Get design system recommendations for multiple industries.
134
+ * Useful for projects that span multiple industries.
135
+ *
136
+ * @param industryIds - Array of industry IDs
137
+ * @returns Aggregated design system recommendations
138
+ */
139
+ export declare function getAggregatedDesignSystems(industryIds: string[]): DesignSystemId[];
140
+ /**
141
+ * Industry Detector API.
142
+ *
143
+ * Provides methods for detecting industries from user input
144
+ * and getting recommendations.
145
+ *
146
+ * @example
147
+ * ```typescript
148
+ * import { IndustryDetector } from '@nikkory/vibe-core';
149
+ *
150
+ * // Detect industry from text
151
+ * const result = IndustryDetector.detect("building a banking app");
152
+ *
153
+ * // Get recommendation
154
+ * const rec = IndustryDetector.getRecommendation('finance');
155
+ *
156
+ * // Get recommendation from input
157
+ * const autoRec = IndustryDetector.fromInput("fintech payment gateway");
158
+ * ```
159
+ */
160
+ export declare const IndustryDetector: {
161
+ /** Detect industry from input text */
162
+ detect: typeof detectIndustry;
163
+ /** Detect multiple industries */
164
+ detectMultiple: typeof detectMultipleIndustries;
165
+ /** Get recommendation for industry ID */
166
+ getRecommendation: typeof getIndustryRecommendation;
167
+ /** Get recommendation from input text */
168
+ fromInput: typeof getRecommendationFromInput;
169
+ /** Get all available industry IDs */
170
+ getAvailable: typeof getAvailableIndustries;
171
+ /** Get industry preset by ID */
172
+ getPreset: typeof getIndustryPreset;
173
+ /** Get industries by category */
174
+ getByCategory: typeof getIndustriesByCategory;
175
+ /** Search industries by keyword */
176
+ search: typeof searchIndustries;
177
+ /** Validate industry ID */
178
+ isValid: typeof isValidIndustry;
179
+ /** Get aggregated design systems for multiple industries */
180
+ getAggregatedDesignSystems: typeof getAggregatedDesignSystems;
181
+ };
182
+ export default IndustryDetector;
183
+ //# sourceMappingURL=IndustryDetector.d.ts.map