@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,312 @@
1
+ /**
2
+ * Section Generator
3
+ * Generates complete sections from SectionConfig with slot resolution and factor propagation
4
+ *
5
+ * @packageDocumentation
6
+ * @module generators/SectionGenerator
7
+ * @since 4.0.0
8
+ *
9
+ * The SectionGenerator:
10
+ * 1. Takes a SectionConfig with 14 fields
11
+ * 2. Resolves slots to components
12
+ * 3. Propagates 13 section factors to child components
13
+ * 4. Generates complete JSX output
14
+ *
15
+ * Powered by Nikkory
16
+ */
17
+ import { type SectionGenerationResult as ComponentSectionGenerationResult } from './section-orchestrator';
18
+ import type { SectionConfig, SectionFactors, SectionWithFactors, LayoutType, SpacingLevel, Tier, DesignSystem, ComponentType, StoredComponentInSlot } from '../types';
19
+ /**
20
+ * Section generation input
21
+ */
22
+ export interface SectionGenerationInput {
23
+ /** Section configuration (14 fields) */
24
+ readonly config: SectionConfig;
25
+ /** Section factors for propagation (13 factors) */
26
+ readonly factors: SectionFactors;
27
+ /** Additional generation options */
28
+ readonly options?: SectionGeneratorOptions;
29
+ /** Stored components in slots (for orchestrator) */
30
+ readonly storedComponents?: readonly StoredComponentInSlot[];
31
+ }
32
+ /**
33
+ * Section generator options
34
+ */
35
+ export interface SectionGeneratorOptions {
36
+ /** Include wrapper div */
37
+ readonly includeWrapper?: boolean;
38
+ /** Custom wrapper class */
39
+ readonly wrapperClass?: string;
40
+ /** Generate TypeScript or JavaScript */
41
+ readonly typescript?: boolean;
42
+ /** Include CSS variables inline */
43
+ readonly inlineCssVariables?: boolean;
44
+ /** Add data attributes for factor values */
45
+ readonly includeDataAttributes?: boolean;
46
+ }
47
+ /**
48
+ * Generated slot content
49
+ */
50
+ export interface GeneratedSlot {
51
+ /** Slot identifier */
52
+ readonly slotId: string;
53
+ /** Generated JSX content */
54
+ readonly content: string;
55
+ /** Components used in this slot */
56
+ readonly components: readonly ComponentType[];
57
+ }
58
+ /**
59
+ * Section generation result
60
+ */
61
+ export interface SectionGenerationResult {
62
+ /** Whether generation succeeded */
63
+ readonly success: boolean;
64
+ /** Error message if failed */
65
+ readonly error?: string;
66
+ /** Generated JSX code */
67
+ readonly jsx: string;
68
+ /** Generated CSS (Tailwind classes) */
69
+ readonly css: string;
70
+ /** CSS variables for theming */
71
+ readonly cssVariables: Record<string, string>;
72
+ /** Data attributes applied */
73
+ readonly dataAttributes: readonly string[];
74
+ /** Generated slots */
75
+ readonly slots: readonly GeneratedSlot[];
76
+ /** Metadata about generation */
77
+ readonly metadata: SectionGenerationMetadata;
78
+ }
79
+ /**
80
+ * Section generation metadata
81
+ */
82
+ export interface SectionGenerationMetadata {
83
+ /** Section ID */
84
+ readonly sectionId: string;
85
+ /** Section type */
86
+ readonly sectionType: string;
87
+ /** Design system used */
88
+ readonly designSystem: DesignSystem;
89
+ /** Quality tier */
90
+ readonly tier: Tier;
91
+ /** Factors applied count */
92
+ readonly factorsApplied: number;
93
+ /** Components generated */
94
+ readonly componentsGenerated: number;
95
+ /** Lines of code */
96
+ readonly linesOfCode: number;
97
+ /** Generation timestamp */
98
+ readonly generatedAt: Date;
99
+ /** Section generation result (if section generator was used) */
100
+ readonly sectionGenerationResult?: ComponentSectionGenerationResult;
101
+ }
102
+ /**
103
+ * Section Generator
104
+ *
105
+ * Generates complete section JSX from SectionConfig and SectionFactors.
106
+ * Handles slot resolution and factor propagation to child components.
107
+ *
108
+ * @example
109
+ * ```typescript
110
+ * const generator = new SectionGenerator();
111
+ *
112
+ * const result = generator.generate({
113
+ * config: {
114
+ * sectionId: 'hero-1',
115
+ * sectionType: 'hero',
116
+ * title: 'Welcome',
117
+ * designSystem: 'material-design',
118
+ * tier: 'enterprise',
119
+ * layout: 'flex',
120
+ * columns: 2,
121
+ * spacing: 'lg',
122
+ * },
123
+ * factors: {
124
+ * colorPrimary: '#2196f3',
125
+ * // ... other 12 factors
126
+ * },
127
+ * });
128
+ *
129
+ * console.log(result.jsx);
130
+ * ```
131
+ */
132
+ export declare class SectionGenerator {
133
+ private readonly defaultOptions;
134
+ private readonly orchestrator;
135
+ /**
136
+ * Create a new SectionGenerator instance
137
+ *
138
+ * @param options - Default generator options
139
+ */
140
+ constructor(options?: SectionGeneratorOptions);
141
+ /**
142
+ * Generate a section from config and factors
143
+ *
144
+ * @param input - Section generation input
145
+ * @returns Section generation result
146
+ */
147
+ generate(input: SectionGenerationInput): SectionGenerationResult;
148
+ /**
149
+ * Generate a section asynchronously with full orchestration support
150
+ *
151
+ * @param input - Section generation input (must include storedComponents)
152
+ * @returns Promise of section generation result with orchestration
153
+ */
154
+ generateAsync(input: SectionGenerationInput): Promise<SectionGenerationResult>;
155
+ /**
156
+ * Enhance generation with orchestrator (internal async helper)
157
+ */
158
+ private enhanceWithSectionGenerator;
159
+ /**
160
+ * Convert section generation result to GeneratedSlot array
161
+ */
162
+ private convertSectionGenerationToSlots;
163
+ /**
164
+ * Generate section from SectionWithFactors interface
165
+ *
166
+ * @param sectionWithFactors - Section with embedded factors
167
+ * @returns Section generation result
168
+ */
169
+ generateFromSectionWithFactors(sectionWithFactors: SectionWithFactors): SectionGenerationResult;
170
+ /**
171
+ * Transform SectionConfig to JSX string
172
+ *
173
+ * @param config - Section configuration
174
+ * @param factors - Section factors
175
+ * @returns JSX string
176
+ */
177
+ transformToJsx(config: SectionConfig, factors: SectionFactors): string;
178
+ /**
179
+ * Get layout classes for a section
180
+ *
181
+ * @param layout - Layout type
182
+ * @param columns - Column count
183
+ * @param spacing - Spacing level
184
+ * @returns Tailwind class string
185
+ */
186
+ getLayoutClasses(layout: LayoutType, columns: 1 | 2 | 3 | 4 | 6, spacing: SpacingLevel): string;
187
+ /**
188
+ * Validate generation input
189
+ */
190
+ private validateInput;
191
+ /**
192
+ * Build CSS classes from config and factors
193
+ */
194
+ private buildCssClasses;
195
+ /**
196
+ * Build CSS variables from factors
197
+ */
198
+ private buildCssVariables;
199
+ /**
200
+ * Build data attributes from config and factors
201
+ */
202
+ private buildDataAttributes;
203
+ /**
204
+ * Generate slots from config
205
+ */
206
+ private generateSlots;
207
+ /**
208
+ * Generate a single slot
209
+ */
210
+ private generateSlot;
211
+ /**
212
+ * Generate slot content placeholder
213
+ */
214
+ private generateSlotContent;
215
+ /**
216
+ * Get slot classes based on position
217
+ */
218
+ private getSlotClasses;
219
+ /**
220
+ * Generate complete JSX
221
+ */
222
+ private generateJsx;
223
+ /**
224
+ * Generate file header
225
+ */
226
+ private generateHeader;
227
+ /**
228
+ * Generate imports based on tier
229
+ */
230
+ private generateImports;
231
+ /**
232
+ * Generate props interface
233
+ */
234
+ private generatePropsInterface;
235
+ /**
236
+ * Generate component body based on tier
237
+ */
238
+ private generateComponentBody;
239
+ /**
240
+ * Generate basic tier component body
241
+ */
242
+ private generateBasicBody;
243
+ /**
244
+ * Generate standard tier component body
245
+ */
246
+ private generateStandardBody;
247
+ /**
248
+ * Generate enterprise tier component body
249
+ */
250
+ private generateEnterpriseBody;
251
+ /**
252
+ * Build style object string from CSS variables
253
+ */
254
+ private buildStyleObject;
255
+ /**
256
+ * Get component name from config
257
+ */
258
+ private getComponentName;
259
+ /**
260
+ * Build generation metadata
261
+ */
262
+ private buildMetadata;
263
+ /**
264
+ * Create error result
265
+ */
266
+ private createErrorResult;
267
+ }
268
+ /**
269
+ * Create a new SectionGenerator instance
270
+ *
271
+ * @param options - Generator options
272
+ * @returns New SectionGenerator instance
273
+ */
274
+ export declare function createSectionGenerator(options?: SectionGeneratorOptions): SectionGenerator;
275
+ /**
276
+ * Generate a section with default options (convenience wrapper)
277
+ *
278
+ * @param input - Section generation input
279
+ * @returns Section generation result
280
+ */
281
+ export declare function generateSection(input: SectionGenerationInput): SectionGenerationResult;
282
+ /**
283
+ * Transform SectionConfig to JSX (convenience wrapper)
284
+ *
285
+ * @param config - Section configuration
286
+ * @param factors - Section factors
287
+ * @returns JSX string
288
+ */
289
+ export declare function transformSectionToJsx(config: SectionConfig, factors: SectionFactors): string;
290
+ /**
291
+ * Generate a section with full orchestration support (async)
292
+ *
293
+ * @param input - Section generation input with storedComponents
294
+ * @returns Promise of section generation result
295
+ *
296
+ * @example
297
+ * ```typescript
298
+ * const result = await generateSectionAsync({
299
+ * config: sectionConfig,
300
+ * factors: sectionFactors,
301
+ * storedComponents: [
302
+ * { instanceId: 'header-1', componentRef: 'button', visible: true },
303
+ * ],
304
+ * });
305
+ *
306
+ * if (result.success) {
307
+ * console.log(result.metadata.sectionGenerationResult?.composedCode);
308
+ * }
309
+ * ```
310
+ */
311
+ export declare function generateSectionAsync(input: SectionGenerationInput): Promise<SectionGenerationResult>;
312
+ //# sourceMappingURL=SectionGenerator.d.ts.map
@@ -0,0 +1,295 @@
1
+ /**
2
+ * Slot Resolver
3
+ * Resolves slots in sections to actual component instances
4
+ *
5
+ * @packageDocumentation
6
+ * @module generators/SlotResolver
7
+ * @since 4.0.0
8
+ *
9
+ * The SlotResolver:
10
+ * 1. Takes SlotConfig definitions
11
+ * 2. Looks up components from the component registry
12
+ * 3. Resolves stored component instances
13
+ * 4. Returns ready-to-render component configurations
14
+ *
15
+ * Powered by Nikkory
16
+ */
17
+ import { getComponentEntry } from '../registries/components-registry';
18
+ import type { SlotConfig, SlotPosition, ComponentType, DesignSystem, Tier } from '../types';
19
+ /**
20
+ * Stored component instance in a slot
21
+ * Represents a user's customized component placement
22
+ */
23
+ export interface StoredComponentInSlot {
24
+ /** Reference to component type */
25
+ readonly componentRef: ComponentType;
26
+ /** Unique instance ID for this placement */
27
+ readonly instanceId: string;
28
+ /** User's property overrides */
29
+ readonly propOverrides: Record<string, unknown>;
30
+ /** Order within the slot */
31
+ readonly order: number;
32
+ /** Whether visible in this section */
33
+ readonly visible: boolean;
34
+ }
35
+ /**
36
+ * Resolved component ready for rendering
37
+ */
38
+ export interface ResolvedComponent {
39
+ /** Component type */
40
+ readonly componentType: ComponentType;
41
+ /** Instance ID */
42
+ readonly instanceId: string;
43
+ /** Display name */
44
+ readonly displayName: string;
45
+ /** Category */
46
+ readonly category: string;
47
+ /** Final props (merged from defaults and overrides) */
48
+ readonly props: Record<string, unknown>;
49
+ /** Whether component supports the design system */
50
+ readonly supportsDesignSystem: boolean;
51
+ /** Whether component supports the tier */
52
+ readonly supportsTier: boolean;
53
+ /** Render order */
54
+ readonly order: number;
55
+ /** Visibility */
56
+ readonly visible: boolean;
57
+ }
58
+ /**
59
+ * Resolved slot with all components
60
+ */
61
+ export interface ResolvedSlot {
62
+ /** Slot ID */
63
+ readonly slotId: string;
64
+ /** Slot position */
65
+ readonly position: SlotPosition;
66
+ /** Resolved components */
67
+ readonly components: readonly ResolvedComponent[];
68
+ /** Number of components */
69
+ readonly componentCount: number;
70
+ /** Whether slot is empty */
71
+ readonly isEmpty: boolean;
72
+ /** Whether slot has room for more components */
73
+ readonly hasCapacity: boolean;
74
+ /** Remaining capacity */
75
+ readonly remainingCapacity: number;
76
+ }
77
+ /**
78
+ * Slot resolution input
79
+ */
80
+ export interface SlotResolutionInput {
81
+ /** Slot configuration */
82
+ readonly slot: SlotConfig;
83
+ /** Stored components in slot */
84
+ readonly storedComponents: readonly StoredComponentInSlot[];
85
+ /** Design system context */
86
+ readonly designSystem: DesignSystem;
87
+ /** Tier context */
88
+ readonly tier: Tier;
89
+ }
90
+ /**
91
+ * Slot resolution result
92
+ */
93
+ export interface SlotResolutionResult {
94
+ /** Whether resolution succeeded */
95
+ readonly success: boolean;
96
+ /** Error message if failed */
97
+ readonly error?: string;
98
+ /** Resolved slot */
99
+ readonly slot: ResolvedSlot;
100
+ /** Warnings (e.g., incompatible components) */
101
+ readonly warnings: readonly string[];
102
+ }
103
+ /**
104
+ * Batch slot resolution input
105
+ */
106
+ export interface BatchSlotResolutionInput {
107
+ /** Slot configurations */
108
+ readonly slots: readonly SlotConfig[];
109
+ /** Map of slot ID to stored components */
110
+ readonly storedComponentsMap: Record<string, readonly StoredComponentInSlot[]>;
111
+ /** Design system context */
112
+ readonly designSystem: DesignSystem;
113
+ /** Tier context */
114
+ readonly tier: Tier;
115
+ }
116
+ /**
117
+ * Batch slot resolution result
118
+ */
119
+ export interface BatchSlotResolutionResult {
120
+ /** Whether all resolutions succeeded */
121
+ readonly success: boolean;
122
+ /** Resolved slots by ID */
123
+ readonly slots: Record<string, ResolvedSlot>;
124
+ /** All warnings */
125
+ readonly warnings: readonly string[];
126
+ /** Total components resolved */
127
+ readonly totalComponentsResolved: number;
128
+ }
129
+ /**
130
+ * Slot resolver options
131
+ */
132
+ export interface SlotResolverOptions {
133
+ /** Include default components if slot is empty */
134
+ readonly includeDefaults?: boolean;
135
+ /** Filter out invisible components */
136
+ readonly filterInvisible?: boolean;
137
+ /** Validate component compatibility */
138
+ readonly validateCompatibility?: boolean;
139
+ /** Strict mode - fail on incompatible components */
140
+ readonly strictMode?: boolean;
141
+ }
142
+ /**
143
+ * Slot Resolver
144
+ *
145
+ * Resolves slots in sections to actual component instances.
146
+ * Handles component lookup, validation, and prop merging.
147
+ *
148
+ * @example
149
+ * ```typescript
150
+ * const resolver = new SlotResolver();
151
+ *
152
+ * const result = resolver.resolve({
153
+ * slot: {
154
+ * slotId: 'header-slot',
155
+ * position: 'header',
156
+ * allowedComponents: ['button', 'input'],
157
+ * maxComponents: 3,
158
+ * },
159
+ * storedComponents: [
160
+ * {
161
+ * componentRef: 'button',
162
+ * instanceId: 'btn-1',
163
+ * propOverrides: { variant: 'primary' },
164
+ * order: 0,
165
+ * visible: true,
166
+ * }
167
+ * ],
168
+ * designSystem: 'material-design',
169
+ * tier: 'enterprise',
170
+ * });
171
+ *
172
+ * console.log(result.slot.components);
173
+ * ```
174
+ */
175
+ export declare class SlotResolver {
176
+ private readonly options;
177
+ /**
178
+ * Create a new SlotResolver instance
179
+ *
180
+ * @param options - Resolver options
181
+ */
182
+ constructor(options?: SlotResolverOptions);
183
+ /**
184
+ * Resolve a single slot
185
+ *
186
+ * @param input - Slot resolution input
187
+ * @returns Slot resolution result
188
+ */
189
+ resolve(input: SlotResolutionInput): SlotResolutionResult;
190
+ /**
191
+ * Resolve multiple slots in batch
192
+ *
193
+ * @param input - Batch resolution input
194
+ * @returns Batch resolution result
195
+ */
196
+ resolveBatch(input: BatchSlotResolutionInput): BatchSlotResolutionResult;
197
+ /**
198
+ * Check if a component is allowed in a slot
199
+ *
200
+ * @param componentType - Component type to check
201
+ * @param slot - Slot configuration
202
+ * @returns Whether component is allowed
203
+ */
204
+ isComponentAllowed(componentType: ComponentType, slot: SlotConfig): boolean;
205
+ /**
206
+ * Check if a component supports a design system
207
+ *
208
+ * @param componentType - Component type
209
+ * @param designSystem - Design system
210
+ * @returns Whether component supports the design system
211
+ */
212
+ componentSupportsDesignSystem(componentType: ComponentType, designSystem: DesignSystem): boolean;
213
+ /**
214
+ * Check if a component supports a tier
215
+ *
216
+ * @param componentType - Component type
217
+ * @param tier - Quality tier
218
+ * @returns Whether component supports the tier
219
+ */
220
+ componentSupportsTier(componentType: ComponentType, tier: Tier): boolean;
221
+ /**
222
+ * Get all allowed components for a slot that support a design system and tier
223
+ *
224
+ * @param slot - Slot configuration
225
+ * @param designSystem - Design system
226
+ * @param tier - Quality tier
227
+ * @returns Array of compatible component types
228
+ */
229
+ getCompatibleComponents(slot: SlotConfig, designSystem: DesignSystem, tier: Tier): ComponentType[];
230
+ /**
231
+ * Lookup a component by type
232
+ *
233
+ * @param componentType - Component type to lookup
234
+ * @returns Component entry or undefined
235
+ */
236
+ lookupComponent(componentType: ComponentType): ReturnType<typeof getComponentEntry>;
237
+ /**
238
+ * Get all available component types
239
+ *
240
+ * @returns Array of all component types
241
+ */
242
+ getAllComponentTypes(): ComponentType[];
243
+ /**
244
+ * Validate slot configuration
245
+ *
246
+ * @param slot - Slot configuration to validate
247
+ * @returns Validation result
248
+ */
249
+ validateSlot(slot: SlotConfig): {
250
+ valid: boolean;
251
+ errors: string[];
252
+ };
253
+ /**
254
+ * Resolve a single component
255
+ */
256
+ private resolveComponent;
257
+ /**
258
+ * Get default props for a component
259
+ */
260
+ private getDefaultProps;
261
+ /**
262
+ * Create an empty resolved slot
263
+ */
264
+ private createEmptySlot;
265
+ }
266
+ /**
267
+ * Create a new SlotResolver instance
268
+ *
269
+ * @param options - Resolver options
270
+ * @returns New SlotResolver instance
271
+ */
272
+ export declare function createSlotResolver(options?: SlotResolverOptions): SlotResolver;
273
+ /**
274
+ * Resolve a slot (convenience wrapper)
275
+ *
276
+ * @param input - Slot resolution input
277
+ * @returns Slot resolution result
278
+ */
279
+ export declare function resolveSlot(input: SlotResolutionInput): SlotResolutionResult;
280
+ /**
281
+ * Resolve multiple slots (convenience wrapper)
282
+ *
283
+ * @param input - Batch resolution input
284
+ * @returns Batch resolution result
285
+ */
286
+ export declare function resolveSlots(input: BatchSlotResolutionInput): BatchSlotResolutionResult;
287
+ /**
288
+ * Check if a component is allowed in a slot (convenience wrapper)
289
+ *
290
+ * @param componentType - Component type
291
+ * @param slot - Slot configuration
292
+ * @returns Whether component is allowed
293
+ */
294
+ export declare function isComponentAllowedInSlot(componentType: ComponentType, slot: SlotConfig): boolean;
295
+ //# sourceMappingURL=SlotResolver.d.ts.map