@specverse/engines 4.1.30 → 4.2.1

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 (285) hide show
  1. package/assets/examples/manifests/frontend-only.yaml +3 -6
  2. package/assets/examples/manifests/fullstack-app.yaml +5 -7
  3. package/assets/examples/manifests/fullstack-monorepo.yaml +3 -6
  4. package/assets/templates/default/specs/main.specly +65 -0
  5. package/dist/inference/comprehensive-engine.d.ts.map +1 -1
  6. package/dist/inference/comprehensive-engine.js +3 -19
  7. package/dist/inference/comprehensive-engine.js.map +1 -1
  8. package/dist/inference/core/rule-engine.d.ts +31 -0
  9. package/dist/inference/core/rule-engine.d.ts.map +1 -1
  10. package/dist/inference/core/rule-engine.js +117 -33
  11. package/dist/inference/core/rule-engine.js.map +1 -1
  12. package/dist/inference/core/rule-file-types.d.ts +0 -2
  13. package/dist/inference/core/rule-file-types.d.ts.map +1 -1
  14. package/dist/inference/core/rule-file-types.js +3 -6
  15. package/dist/inference/core/rule-file-types.js.map +1 -1
  16. package/dist/inference/core/rule-loader.d.ts +5 -15
  17. package/dist/inference/core/rule-loader.d.ts.map +1 -1
  18. package/dist/inference/core/rule-loader.js +43 -132
  19. package/dist/inference/core/rule-loader.js.map +1 -1
  20. package/dist/inference/core/types.d.ts +0 -6
  21. package/dist/inference/core/types.d.ts.map +1 -1
  22. package/dist/inference/core/types.js +0 -4
  23. package/dist/inference/core/types.js.map +1 -1
  24. package/dist/inference/logical/generators/component-type-resolver.d.ts +0 -26
  25. package/dist/inference/logical/generators/component-type-resolver.d.ts.map +1 -1
  26. package/dist/inference/logical/generators/component-type-resolver.js +0 -19
  27. package/dist/inference/logical/generators/component-type-resolver.js.map +1 -1
  28. package/dist/inference/logical/generators/specialist-view-expander.d.ts +1 -17
  29. package/dist/inference/logical/generators/specialist-view-expander.d.ts.map +1 -1
  30. package/dist/inference/logical/generators/specialist-view-expander.js +0 -15
  31. package/dist/inference/logical/generators/specialist-view-expander.js.map +1 -1
  32. package/dist/inference/logical/generators/view-generator.d.ts +4 -14
  33. package/dist/inference/logical/generators/view-generator.d.ts.map +1 -1
  34. package/dist/inference/logical/generators/view-generator.js +6 -26
  35. package/dist/inference/logical/generators/view-generator.js.map +1 -1
  36. package/dist/inference/logical/index.d.ts +2 -2
  37. package/dist/inference/logical/index.d.ts.map +1 -1
  38. package/dist/inference/logical/logical-engine.d.ts.map +1 -1
  39. package/dist/inference/logical/logical-engine.js +17 -80
  40. package/dist/inference/logical/logical-engine.js.map +1 -1
  41. package/dist/inference/quint-transpiler.d.ts +5 -3
  42. package/dist/inference/quint-transpiler.d.ts.map +1 -1
  43. package/dist/inference/quint-transpiler.js +11 -6
  44. package/dist/inference/quint-transpiler.js.map +1 -1
  45. package/dist/libs/instance-factories/CURVED-INTERFACE.md +278 -0
  46. package/dist/libs/instance-factories/README.md +73 -0
  47. package/dist/libs/instance-factories/applications/README.md +51 -0
  48. package/dist/libs/instance-factories/applications/generic-app.yaml +52 -0
  49. package/{libs/instance-factories/applications/react-app.yaml → dist/libs/instance-factories/applications/react-app-runtime.yaml} +30 -77
  50. package/dist/libs/instance-factories/applications/react-app-starter.yaml +143 -0
  51. package/dist/libs/instance-factories/applications/templates/react/env-example-generator.js +24 -2
  52. package/dist/libs/instance-factories/applications/templates/react/vite-config-generator.js +54 -33
  53. package/dist/libs/instance-factories/applications/templates/react-starter/README.md +211 -0
  54. package/dist/libs/instance-factories/applications/templates/react-starter/api-types-starter-generator.js +69 -0
  55. package/dist/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.js +110 -0
  56. package/dist/libs/instance-factories/applications/templates/react-starter/belongs-to.js +40 -0
  57. package/dist/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.js +129 -0
  58. package/dist/libs/instance-factories/applications/templates/react-starter/detail-body-composer.js +80 -0
  59. package/dist/libs/instance-factories/applications/templates/react-starter/form-body-composer.js +217 -0
  60. package/dist/libs/instance-factories/applications/templates/react-starter/helpers-emitter.js +51 -0
  61. package/dist/libs/instance-factories/applications/templates/react-starter/html-to-jsx.js +192 -0
  62. package/dist/libs/instance-factories/applications/templates/react-starter/list-body-composer.js +56 -0
  63. package/dist/libs/instance-factories/applications/templates/react-starter/orchestrator.js +41 -0
  64. package/dist/libs/instance-factories/applications/templates/react-starter/package-json-generator.js +38 -0
  65. package/dist/libs/instance-factories/applications/templates/react-starter/regen-safety.js +89 -0
  66. package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/dashboard.tsx.template +49 -0
  67. package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +96 -0
  68. package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +116 -0
  69. package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +74 -0
  70. package/dist/libs/instance-factories/applications/templates/react-starter/use-api-hooks-starter-generator.js +95 -0
  71. package/dist/libs/instance-factories/applications/templates/react-starter/view-emitter.js +81 -0
  72. package/dist/libs/instance-factories/applications/templates/react-starter/views-generator.js +66 -0
  73. package/dist/libs/instance-factories/archived/fastify-prisma.yaml +104 -0
  74. package/dist/libs/instance-factories/cli/README.md +43 -0
  75. package/dist/libs/instance-factories/cli/commander-js.yaml +55 -0
  76. package/dist/libs/instance-factories/cli/templates/commander/command-generator.js +63 -12
  77. package/dist/libs/instance-factories/communication/README.md +47 -0
  78. package/dist/libs/instance-factories/communication/event-emitter.yaml +60 -0
  79. package/dist/libs/instance-factories/communication/rabbitmq-events.yaml +87 -0
  80. package/dist/libs/instance-factories/controllers/README.md +42 -0
  81. package/dist/libs/instance-factories/controllers/fastify.yaml +139 -0
  82. package/dist/libs/instance-factories/controllers/templates/fastify/server-generator.js +29 -2
  83. package/dist/libs/instance-factories/infrastructure/README.md +29 -0
  84. package/dist/libs/instance-factories/infrastructure/docker-k8s.yaml +61 -0
  85. package/dist/libs/instance-factories/orms/README.md +54 -0
  86. package/dist/libs/instance-factories/orms/prisma.yaml +89 -0
  87. package/dist/libs/instance-factories/orms/templates/prisma/schema-generator.js +2 -2
  88. package/dist/libs/instance-factories/scaffolding/README.md +49 -0
  89. package/dist/libs/instance-factories/scaffolding/generic-scaffold.yaml +65 -0
  90. package/dist/libs/instance-factories/sdks/README.md +28 -0
  91. package/dist/libs/instance-factories/sdks/python-sdk.yaml +66 -0
  92. package/dist/libs/instance-factories/sdks/typescript-sdk.yaml +59 -0
  93. package/dist/libs/instance-factories/services/README.md +55 -0
  94. package/dist/libs/instance-factories/services/prisma-services.yaml +71 -0
  95. package/dist/libs/instance-factories/storage/README.md +34 -0
  96. package/dist/libs/instance-factories/storage/mongodb.yaml +79 -0
  97. package/dist/libs/instance-factories/storage/postgresql.yaml +75 -0
  98. package/dist/libs/instance-factories/storage/redis.yaml +79 -0
  99. package/dist/libs/instance-factories/testing/README.md +40 -0
  100. package/dist/libs/instance-factories/testing/vitest-tests.yaml +63 -0
  101. package/dist/libs/instance-factories/tools/README.md +70 -0
  102. package/dist/libs/instance-factories/tools/mcp.yaml +36 -0
  103. package/dist/libs/instance-factories/tools/vscode.yaml +35 -0
  104. package/dist/libs/instance-factories/validation/README.md +38 -0
  105. package/dist/libs/instance-factories/validation/zod.yaml +56 -0
  106. package/dist/realize/engines/code-generator.d.ts.map +1 -1
  107. package/dist/realize/engines/code-generator.js +3 -0
  108. package/dist/realize/engines/code-generator.js.map +1 -1
  109. package/dist/realize/index.d.ts.map +1 -1
  110. package/dist/realize/index.js +15 -22
  111. package/dist/realize/index.js.map +1 -1
  112. package/dist/registry/utils/manifest-adapter.d.ts +8 -1
  113. package/dist/registry/utils/manifest-adapter.d.ts.map +1 -1
  114. package/dist/registry/utils/manifest-adapter.js +8 -1
  115. package/dist/registry/utils/manifest-adapter.js.map +1 -1
  116. package/libs/instance-factories/applications/react-app-starter.yaml +143 -0
  117. package/libs/instance-factories/applications/templates/react/env-example-generator.ts +24 -2
  118. package/libs/instance-factories/applications/templates/react/vite-config-generator.ts +54 -33
  119. package/libs/instance-factories/applications/templates/react-starter/README.md +211 -0
  120. package/libs/instance-factories/applications/templates/react-starter/__tests__/dashboard-body-composer.test.ts +153 -0
  121. package/libs/instance-factories/applications/templates/react-starter/__tests__/detail-body-composer.test.ts +146 -0
  122. package/libs/instance-factories/applications/templates/react-starter/__tests__/form-body-composer.test.ts +188 -0
  123. package/libs/instance-factories/applications/templates/react-starter/__tests__/helpers-emitter.test.ts +55 -0
  124. package/libs/instance-factories/applications/templates/react-starter/__tests__/html-to-jsx.test.ts +140 -0
  125. package/libs/instance-factories/applications/templates/react-starter/__tests__/list-body-composer.test.ts +146 -0
  126. package/libs/instance-factories/applications/templates/react-starter/__tests__/orchestrator.test.ts +184 -0
  127. package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p2-factory-imports.test.ts +116 -0
  128. package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p3-rendered-output.test.ts +183 -0
  129. package/libs/instance-factories/applications/templates/react-starter/__tests__/regen-safety.test.ts +144 -0
  130. package/libs/instance-factories/applications/templates/react-starter/__tests__/starter-generators.test.ts +114 -0
  131. package/libs/instance-factories/applications/templates/react-starter/__tests__/view-emitter.test.ts +107 -0
  132. package/libs/instance-factories/applications/templates/react-starter/__tests__/views-generator.test.ts +139 -0
  133. package/libs/instance-factories/applications/templates/react-starter/api-types-starter-generator.ts +98 -0
  134. package/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.ts +141 -0
  135. package/libs/instance-factories/applications/templates/react-starter/belongs-to.ts +82 -0
  136. package/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.ts +189 -0
  137. package/libs/instance-factories/applications/templates/react-starter/detail-body-composer.ts +135 -0
  138. package/libs/instance-factories/applications/templates/react-starter/form-body-composer.ts +383 -0
  139. package/libs/instance-factories/applications/templates/react-starter/helpers-emitter.ts +66 -0
  140. package/libs/instance-factories/applications/templates/react-starter/html-to-jsx.ts +334 -0
  141. package/libs/instance-factories/applications/templates/react-starter/list-body-composer.ts +146 -0
  142. package/libs/instance-factories/applications/templates/react-starter/orchestrator.ts +95 -0
  143. package/libs/instance-factories/applications/templates/react-starter/package-json-generator.ts +57 -0
  144. package/libs/instance-factories/applications/templates/react-starter/regen-safety.ts +157 -0
  145. package/libs/instance-factories/applications/templates/react-starter/skeletons/dashboard.tsx.template +49 -0
  146. package/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +96 -0
  147. package/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +116 -0
  148. package/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +74 -0
  149. package/libs/instance-factories/applications/templates/react-starter/use-api-hooks-starter-generator.ts +124 -0
  150. package/libs/instance-factories/applications/templates/react-starter/view-emitter.ts +209 -0
  151. package/libs/instance-factories/applications/templates/react-starter/views-generator.ts +137 -0
  152. package/libs/instance-factories/cli/templates/commander/command-generator.ts +63 -12
  153. package/libs/instance-factories/controllers/fastify.yaml +7 -0
  154. package/libs/instance-factories/controllers/templates/fastify/server-generator.ts +36 -2
  155. package/libs/instance-factories/orms/templates/prisma/schema-generator.ts +11 -4
  156. package/package.json +3 -3
  157. package/dist/libs/instance-factories/applications/templates/react/_view-components-source.js +0 -530
  158. package/dist/libs/instance-factories/applications/templates/react/app-tsx-generator.js +0 -73
  159. package/dist/libs/instance-factories/applications/templates/react/field-helpers-generator.js +0 -99
  160. package/dist/libs/instance-factories/applications/templates/react/package-json-generator.js +0 -49
  161. package/dist/libs/instance-factories/applications/templates/react/pattern-adapter-generator.js +0 -156
  162. package/dist/libs/instance-factories/applications/templates/react/react-pattern-adapter.js +0 -935
  163. package/dist/libs/instance-factories/applications/templates/react/relationship-field-generator.js +0 -143
  164. package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.js +0 -646
  165. package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.js +0 -65
  166. package/dist/libs/instance-factories/applications/templates/react/view-dashboard-generator.js +0 -143
  167. package/dist/libs/instance-factories/applications/templates/react/view-detail-generator.js +0 -143
  168. package/dist/libs/instance-factories/applications/templates/react/view-form-generator.js +0 -355
  169. package/dist/libs/instance-factories/applications/templates/react/view-list-generator.js +0 -91
  170. package/dist/libs/instance-factories/applications/templates/react/view-router-generator.js +0 -79
  171. package/dist/libs/instance-factories/views/index.js +0 -48
  172. package/dist/libs/instance-factories/views/templates/react/adapters/antd-adapter.js +0 -742
  173. package/dist/libs/instance-factories/views/templates/react/adapters/mui-adapter.js +0 -824
  174. package/dist/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.js +0 -719
  175. package/dist/libs/instance-factories/views/templates/react/app-generator.js +0 -45
  176. package/dist/libs/instance-factories/views/templates/react/components-generator.js +0 -820
  177. package/dist/libs/instance-factories/views/templates/react/forms-generator.js +0 -275
  178. package/dist/libs/instance-factories/views/templates/react/frontend-package-json-generator.js +0 -46
  179. package/dist/libs/instance-factories/views/templates/react/hooks-generator.js +0 -81
  180. package/dist/libs/instance-factories/views/templates/react/index-css-generator.js +0 -9
  181. package/dist/libs/instance-factories/views/templates/react/index-html-generator.js +0 -23
  182. package/dist/libs/instance-factories/views/templates/react/main-tsx-generator.js +0 -21
  183. package/dist/libs/instance-factories/views/templates/react/react-component-generator.js +0 -299
  184. package/dist/libs/instance-factories/views/templates/react/router-generator.js +0 -136
  185. package/dist/libs/instance-factories/views/templates/react/router-generic-generator.js +0 -107
  186. package/dist/libs/instance-factories/views/templates/react/shared-utils-generator.js +0 -187
  187. package/dist/libs/instance-factories/views/templates/react/spec-json-generator.js +0 -7
  188. package/dist/libs/instance-factories/views/templates/react/types-generator.js +0 -56
  189. package/dist/libs/instance-factories/views/templates/react/views-metadata-generator.js +0 -27
  190. package/dist/libs/instance-factories/views/templates/react/vite-config-generator.js +0 -29
  191. package/dist/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js +0 -261
  192. package/dist/libs/instance-factories/views/templates/shared/adapter-types.js +0 -34
  193. package/dist/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -800
  194. package/dist/libs/instance-factories/views/templates/shared/base-generator.js +0 -305
  195. package/dist/libs/instance-factories/views/templates/shared/component-metadata.js +0 -517
  196. package/dist/libs/instance-factories/views/templates/shared/composite-pattern-types.js +0 -0
  197. package/dist/libs/instance-factories/views/templates/shared/composite-patterns.js +0 -445
  198. package/dist/libs/instance-factories/views/templates/shared/index.js +0 -80
  199. package/dist/libs/instance-factories/views/templates/shared/pattern-validator.js +0 -210
  200. package/dist/libs/instance-factories/views/templates/shared/property-mapper.js +0 -492
  201. package/dist/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -321
  202. package/dist/realize/index.js.bak +0 -758
  203. package/libs/instance-factories/applications/templates/react/_view-components-source.ts +0 -555
  204. package/libs/instance-factories/applications/templates/react/app-tsx-generator.ts +0 -94
  205. package/libs/instance-factories/applications/templates/react/field-helpers-generator.ts +0 -106
  206. package/libs/instance-factories/applications/templates/react/package-json-generator.ts +0 -57
  207. package/libs/instance-factories/applications/templates/react/pattern-adapter-generator.ts +0 -179
  208. package/libs/instance-factories/applications/templates/react/react-pattern-adapter.tsx +0 -1347
  209. package/libs/instance-factories/applications/templates/react/relationship-field-generator.ts +0 -150
  210. package/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.ts +0 -704
  211. package/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.ts +0 -84
  212. package/libs/instance-factories/applications/templates/react/view-dashboard-generator.ts +0 -150
  213. package/libs/instance-factories/applications/templates/react/view-detail-generator.ts +0 -150
  214. package/libs/instance-factories/applications/templates/react/view-form-generator.ts +0 -362
  215. package/libs/instance-factories/applications/templates/react/view-list-generator.ts +0 -98
  216. package/libs/instance-factories/applications/templates/react/view-router-generator.ts +0 -89
  217. package/libs/instance-factories/views/README.md +0 -62
  218. package/libs/instance-factories/views/index.d.ts +0 -13
  219. package/libs/instance-factories/views/index.d.ts.map +0 -1
  220. package/libs/instance-factories/views/index.js +0 -18
  221. package/libs/instance-factories/views/index.js.map +0 -1
  222. package/libs/instance-factories/views/index.ts +0 -45
  223. package/libs/instance-factories/views/react-components.yaml +0 -129
  224. package/libs/instance-factories/views/templates/ARCHITECTURE.md +0 -198
  225. package/libs/instance-factories/views/templates/react/adapters/antd-adapter.ts +0 -869
  226. package/libs/instance-factories/views/templates/react/adapters/mui-adapter.ts +0 -953
  227. package/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.ts +0 -806
  228. package/libs/instance-factories/views/templates/react/app-generator.ts +0 -55
  229. package/libs/instance-factories/views/templates/react/components-generator.ts +0 -938
  230. package/libs/instance-factories/views/templates/react/forms-generator.ts +0 -325
  231. package/libs/instance-factories/views/templates/react/frontend-package-json-generator.ts +0 -57
  232. package/libs/instance-factories/views/templates/react/hooks-generator.ts +0 -106
  233. package/libs/instance-factories/views/templates/react/index-css-generator.ts +0 -14
  234. package/libs/instance-factories/views/templates/react/index-html-generator.ts +0 -34
  235. package/libs/instance-factories/views/templates/react/main-tsx-generator.ts +0 -29
  236. package/libs/instance-factories/views/templates/react/react-component-generator.d.ts +0 -152
  237. package/libs/instance-factories/views/templates/react/react-component-generator.d.ts.map +0 -1
  238. package/libs/instance-factories/views/templates/react/react-component-generator.js +0 -398
  239. package/libs/instance-factories/views/templates/react/react-component-generator.js.map +0 -1
  240. package/libs/instance-factories/views/templates/react/react-component-generator.ts +0 -533
  241. package/libs/instance-factories/views/templates/react/router-generator.ts +0 -197
  242. package/libs/instance-factories/views/templates/react/router-generic-generator.ts +0 -132
  243. package/libs/instance-factories/views/templates/react/shared-utils-generator.ts +0 -196
  244. package/libs/instance-factories/views/templates/react/spec-json-generator.ts +0 -17
  245. package/libs/instance-factories/views/templates/react/types-generator.ts +0 -76
  246. package/libs/instance-factories/views/templates/react/views-metadata-generator.ts +0 -42
  247. package/libs/instance-factories/views/templates/react/vite-config-generator.ts +0 -38
  248. package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.d.ts.map +0 -1
  249. package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js.map +0 -1
  250. package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.ts +0 -474
  251. package/libs/instance-factories/views/templates/shared/__tests__/composite-patterns.test.ts +0 -242
  252. package/libs/instance-factories/views/templates/shared/adapter-types.d.ts +0 -77
  253. package/libs/instance-factories/views/templates/shared/adapter-types.d.ts.map +0 -1
  254. package/libs/instance-factories/views/templates/shared/adapter-types.js +0 -47
  255. package/libs/instance-factories/views/templates/shared/adapter-types.js.map +0 -1
  256. package/libs/instance-factories/views/templates/shared/adapter-types.ts +0 -142
  257. package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts +0 -63
  258. package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts.map +0 -1
  259. package/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -822
  260. package/libs/instance-factories/views/templates/shared/atomic-components-registry.js.map +0 -1
  261. package/libs/instance-factories/views/templates/shared/atomic-components-registry.ts +0 -908
  262. package/libs/instance-factories/views/templates/shared/base-generator.d.ts +0 -247
  263. package/libs/instance-factories/views/templates/shared/base-generator.d.ts.map +0 -1
  264. package/libs/instance-factories/views/templates/shared/base-generator.js +0 -363
  265. package/libs/instance-factories/views/templates/shared/base-generator.js.map +0 -1
  266. package/libs/instance-factories/views/templates/shared/base-generator.ts +0 -608
  267. package/libs/instance-factories/views/templates/shared/component-metadata.d.ts +0 -254
  268. package/libs/instance-factories/views/templates/shared/component-metadata.d.ts.map +0 -1
  269. package/libs/instance-factories/views/templates/shared/component-metadata.js +0 -602
  270. package/libs/instance-factories/views/templates/shared/component-metadata.js.map +0 -1
  271. package/libs/instance-factories/views/templates/shared/component-metadata.ts +0 -803
  272. package/libs/instance-factories/views/templates/shared/composite-pattern-types.ts +0 -250
  273. package/libs/instance-factories/views/templates/shared/composite-patterns.ts +0 -535
  274. package/libs/instance-factories/views/templates/shared/index.ts +0 -68
  275. package/libs/instance-factories/views/templates/shared/pattern-validator.ts +0 -279
  276. package/libs/instance-factories/views/templates/shared/property-mapper.d.ts +0 -149
  277. package/libs/instance-factories/views/templates/shared/property-mapper.d.ts.map +0 -1
  278. package/libs/instance-factories/views/templates/shared/property-mapper.js +0 -580
  279. package/libs/instance-factories/views/templates/shared/property-mapper.js.map +0 -1
  280. package/libs/instance-factories/views/templates/shared/property-mapper.ts +0 -700
  281. package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts +0 -143
  282. package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts.map +0 -1
  283. package/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -420
  284. package/libs/instance-factories/views/templates/shared/syntax-mapper.js.map +0 -1
  285. package/libs/instance-factories/views/templates/shared/syntax-mapper.ts +0 -539
@@ -1,806 +0,0 @@
1
- /**
2
- * shadcn/ui Adapter
3
- *
4
- * Maps all 49 SpecVerse atomic component types to shadcn/ui components.
5
- * shadcn/ui: https://ui.shadcn.com/
6
- *
7
- * Architecture:
8
- * - Uses @/components/ui/* import pattern
9
- * - Tailwind CSS for styling
10
- * - Radix UI primitives underneath
11
- */
12
-
13
- import type { ComponentLibraryAdapter, RenderContext } from '../../shared/adapter-types.js';
14
- import { renderProps } from '../../shared/adapter-types.js';
15
-
16
- export const shadcnAdapter: ComponentLibraryAdapter = {
17
- name: 'shadcn/ui',
18
- version: 'latest',
19
- description: 'shadcn/ui component library adapter',
20
-
21
- baseDependencies: [
22
- { name: 'react', version: '^18.2.0' },
23
- { name: 'react-dom', version: '^18.2.0' },
24
- { name: 'tailwindcss', version: '^3.4.0' },
25
- { name: '@radix-ui/react-icons', version: '^1.3.0' },
26
- { name: 'class-variance-authority', version: '^0.7.0' },
27
- { name: 'clsx', version: '^2.0.0' },
28
- { name: 'tailwind-merge', version: '^2.0.0' },
29
- ],
30
-
31
- config: {
32
- importPrefix: '@/components/ui',
33
- importStyle: 'named',
34
- },
35
-
36
- components: {
37
- // =====================================================================
38
- // DATA DISPLAY (9 types)
39
- // =====================================================================
40
-
41
- table: {
42
- imports: [
43
- "import { Table, TableHeader, TableBody, TableHead, TableRow, TableCell } from '@/components/ui/table'",
44
- ],
45
- render: (ctx: RenderContext) => {
46
- const { properties, model, name } = ctx;
47
- const columns = properties.columns || ['id'];
48
- const modelVar = model?.name?.toLowerCase() || 'item';
49
- const pluralVar = `${modelVar}s`;
50
-
51
- return `<Table>
52
- <TableHeader>
53
- <TableRow>
54
- ${columns.map((col: string) => `<TableHead>${col}</TableHead>`).join('\n ')}
55
- </TableRow>
56
- </TableHeader>
57
- <TableBody>
58
- {${pluralVar}?.map((${modelVar}) => (
59
- <TableRow key={${modelVar}.id}>
60
- ${columns.map((col: string) => `<TableCell>{${modelVar}.${col}}</TableCell>`).join('\n ')}
61
- </TableRow>
62
- ))}
63
- </TableBody>
64
- </Table>`;
65
- },
66
- dependencies: [{ name: '@/components/ui/table', version: 'latest' }],
67
- },
68
-
69
- list: {
70
- imports: ["import { ScrollArea } from '@/components/ui/scroll-area'"],
71
- render: (ctx: RenderContext) => {
72
- const { properties, children } = ctx;
73
- const className = properties.dense ? 'space-y-1' : 'space-y-4';
74
-
75
- return `<ScrollArea className="${className}">
76
- ${children || '/* List items */'}
77
- </ScrollArea>`;
78
- },
79
- },
80
-
81
- grid: {
82
- imports: [],
83
- render: (ctx: RenderContext) => {
84
- const { properties, children } = ctx;
85
- const columns = properties.columns || 3;
86
- const gap = properties.gap === 'small' ? '2' : properties.gap === 'large' ? '8' : '4';
87
-
88
- return `<div className="grid grid-cols-${columns} gap-${gap}">
89
- ${children || '/* Grid items */'}
90
- </div>`;
91
- },
92
- },
93
-
94
- card: {
95
- imports: [
96
- "import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@/components/ui/card'",
97
- ],
98
- render: (ctx: RenderContext) => {
99
- const { properties, children } = ctx;
100
- const { title, subtitle, variant } = properties;
101
-
102
- if (variant === 'metric') {
103
- return `<Card>
104
- <CardHeader>
105
- <CardTitle className="text-sm font-medium">${title || properties.metric || 'Metric'}</CardTitle>
106
- </CardHeader>
107
- <CardContent>
108
- <div className="text-2xl font-bold">{/* Value */}</div>
109
- ${properties.showTrend ? '<p className="text-xs text-muted-foreground">↑ 12% from last month</p>' : ''}
110
- </CardContent>
111
- </Card>`;
112
- }
113
-
114
- return `<Card>
115
- ${title ? `<CardHeader>
116
- <CardTitle>${title}</CardTitle>
117
- ${subtitle ? `<CardDescription>${subtitle}</CardDescription>` : ''}
118
- </CardHeader>` : ''}
119
- <CardContent>
120
- ${children || '/* Card content */'}
121
- </CardContent>
122
- </Card>`;
123
- },
124
- },
125
-
126
- chart: {
127
- imports: [
128
- "import { LineChart, Line, BarChart, Bar, PieChart, Pie, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer } from 'recharts'",
129
- ],
130
- render: (ctx: RenderContext) => {
131
- const { properties } = ctx;
132
- const chartType = properties.chartType || 'line';
133
-
134
- const chartMap: Record<string, string> = {
135
- line: '<LineChart data={data}><CartesianGrid strokeDasharray="3 3" /><XAxis dataKey="name" /><YAxis /><Tooltip /><Legend /><Line type="monotone" dataKey="value" stroke="#8884d8" /></LineChart>',
136
- bar: '<BarChart data={data}><CartesianGrid strokeDasharray="3 3" /><XAxis dataKey="name" /><YAxis /><Tooltip /><Legend /><Bar dataKey="value" fill="#8884d8" /></BarChart>',
137
- pie: '<PieChart><Pie data={data} dataKey="value" nameKey="name" cx="50%" cy="50%" outerRadius={80} fill="#8884d8" label /></PieChart>',
138
- trend: '<LineChart data={data}><Line type="monotone" dataKey="value" stroke="#8884d8" strokeWidth={2} dot={false} /></LineChart>',
139
- };
140
-
141
- const chart = chartMap[chartType] || chartMap.line;
142
-
143
- return `<ResponsiveContainer width="100%" height={${properties.height || 300}}>
144
- ${chart}
145
- </ResponsiveContainer>`;
146
- },
147
- dependencies: [{ name: 'recharts', version: '^2.10.0' }],
148
- },
149
-
150
- tree: {
151
- imports: [],
152
- render: () => `<div className="tree-view">
153
- {/* TODO: Implement tree component */}
154
- </div>`,
155
- },
156
-
157
- timeline: {
158
- imports: [],
159
- render: (ctx: RenderContext) => {
160
- const { properties, children } = ctx;
161
- const orientation = properties.orientation || 'vertical';
162
-
163
- return `<div className="relative ${orientation === 'horizontal' ? 'flex space-x-8' : 'space-y-8'}">
164
- ${children || '/* Timeline items */'}
165
- </div>`;
166
- },
167
- },
168
-
169
- avatar: {
170
- imports: ["import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'"],
171
- render: (ctx: RenderContext) => {
172
- const { properties } = ctx;
173
- const size = properties.size === 'large' ? 'h-16 w-16' : properties.size === 'small' ? 'h-8 w-8' : 'h-12 w-12';
174
-
175
- return `<Avatar className="${size}">
176
- <AvatarImage src={${properties.src || 'user.avatar'}} alt="${properties.alt || 'Avatar'}" />
177
- <AvatarFallback>${properties.initials || 'U'}</AvatarFallback>
178
- </Avatar>`;
179
- },
180
- },
181
-
182
- image: {
183
- imports: [],
184
- render: (ctx: RenderContext) => {
185
- const { properties } = ctx;
186
- return `<img
187
- src={${properties.src || 'imageSrc'}}
188
- alt="${properties.alt || ''}"
189
- className="${properties.objectFit === 'cover' ? 'object-cover' : 'object-contain'} ${properties.lazy ? 'loading="lazy"' : ''}"
190
- />`;
191
- },
192
- },
193
-
194
- // =====================================================================
195
- // FORMS & INPUTS (11 types)
196
- // =====================================================================
197
-
198
- form: {
199
- imports: ["import { Form } from '@/components/ui/form'"],
200
- render: (ctx: RenderContext) => {
201
- const { children } = ctx;
202
- return `<Form {...form}>
203
- <form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
204
- ${children || '/* Form fields */'}
205
- </form>
206
- </Form>`;
207
- },
208
- },
209
-
210
- input: {
211
- imports: ["import { Input } from '@/components/ui/input'", "import { Label } from '@/components/ui/label'"],
212
- render: (ctx: RenderContext) => {
213
- const { properties } = ctx;
214
- return `<div className="grid w-full items-center gap-1.5">
215
- ${properties.label ? `<Label htmlFor="${properties.name || 'input'}">${properties.label}${properties.required ? ' *' : ''}</Label>` : ''}
216
- <Input
217
- type="${properties.type || 'text'}"
218
- id="${properties.name || 'input'}"
219
- placeholder="${properties.placeholder || ''}"
220
- ${properties.required ? 'required' : ''}
221
- ${properties.disabled ? 'disabled' : ''}
222
- />
223
- ${properties.helperText ? `<p className="text-sm text-muted-foreground">${properties.helperText}</p>` : ''}
224
- </div>`;
225
- },
226
- },
227
-
228
- textarea: {
229
- imports: ["import { Textarea } from '@/components/ui/textarea'", "import { Label } from '@/components/ui/label'"],
230
- render: (ctx: RenderContext) => {
231
- const { properties } = ctx;
232
- return `<div className="grid w-full gap-1.5">
233
- ${properties.label ? `<Label htmlFor="${properties.name || 'textarea'}">${properties.label}</Label>` : ''}
234
- <Textarea
235
- id="${properties.name || 'textarea'}"
236
- placeholder="${properties.placeholder || ''}"
237
- rows={${properties.rows || 4}}
238
- ${properties.required ? 'required' : ''}
239
- />
240
- </div>`;
241
- },
242
- },
243
-
244
- select: {
245
- imports: [
246
- "import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'",
247
- "import { Label } from '@/components/ui/label'",
248
- ],
249
- render: (ctx: RenderContext) => {
250
- const { properties } = ctx;
251
- const options = properties.options || [];
252
-
253
- return `<div className="grid w-full gap-1.5">
254
- ${properties.label ? `<Label>${properties.label}${properties.required ? ' *' : ''}</Label>` : ''}
255
- <Select>
256
- <SelectTrigger>
257
- <SelectValue placeholder="${properties.placeholder || 'Select option'}" />
258
- </SelectTrigger>
259
- <SelectContent>
260
- ${options.map((opt: string) => `<SelectItem value="${opt}">${opt}</SelectItem>`).join('\n ')}
261
- </SelectContent>
262
- </Select>
263
- </div>`;
264
- },
265
- },
266
-
267
- checkbox: {
268
- imports: ["import { Checkbox } from '@/components/ui/checkbox'", "import { Label } from '@/components/ui/label'"],
269
- render: (ctx: RenderContext) => {
270
- const { properties } = ctx;
271
- return `<div className="flex items-center space-x-2">
272
- <Checkbox id="${properties.name || 'checkbox'}" ${properties.checked ? 'checked' : ''} ${properties.disabled ? 'disabled' : ''} />
273
- ${properties.label ? `<Label htmlFor="${properties.name || 'checkbox'}">${properties.label}</Label>` : ''}
274
- </div>`;
275
- },
276
- },
277
-
278
- radio: {
279
- imports: ["import { RadioGroup, RadioGroupItem } from '@/components/ui/radio-group'", "import { Label } from '@/components/ui/label'"],
280
- render: (ctx: RenderContext) => {
281
- const { properties } = ctx;
282
- const options = properties.options || [];
283
-
284
- return `<div className="grid gap-2">
285
- ${properties.label ? `<Label>${properties.label}</Label>` : ''}
286
- <RadioGroup>
287
- ${options.map((opt: string) => `<div className="flex items-center space-x-2">
288
- <RadioGroupItem value="${opt}" id="${opt}" />
289
- <Label htmlFor="${opt}">${opt}</Label>
290
- </div>`).join('\n ')}
291
- </RadioGroup>
292
- </div>`;
293
- },
294
- },
295
-
296
- slider: {
297
- imports: ["import { Slider } from '@/components/ui/slider'", "import { Label } from '@/components/ui/label'"],
298
- render: (ctx: RenderContext) => {
299
- const { properties } = ctx;
300
- return `<div className="grid gap-2">
301
- ${properties.label ? `<Label>${properties.label}</Label>` : ''}
302
- <Slider
303
- min={${properties.min || 0}}
304
- max={${properties.max || 100}}
305
- step={${properties.step || 1}}
306
- defaultValue={[${properties.value || 50}]}
307
- />
308
- ${properties.showValue ? '<span className="text-sm text-muted-foreground">{value}</span>' : ''}
309
- </div>`;
310
- },
311
- },
312
-
313
- switch: {
314
- imports: ["import { Switch } from '@/components/ui/switch'", "import { Label } from '@/components/ui/label'"],
315
- render: (ctx: RenderContext) => {
316
- const { properties } = ctx;
317
- return `<div className="flex items-center space-x-2">
318
- <Switch id="${properties.name || 'switch'}" ${properties.checked ? 'checked' : ''} ${properties.disabled ? 'disabled' : ''} />
319
- ${properties.label ? `<Label htmlFor="${properties.name || 'switch'}">${properties.label}</Label>` : ''}
320
- </div>`;
321
- },
322
- },
323
-
324
- autocomplete: {
325
- imports: [
326
- "import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem } from '@/components/ui/command'",
327
- "import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'",
328
- "import { Button } from '@/components/ui/button'",
329
- ],
330
- render: (ctx: RenderContext) => {
331
- const { properties } = ctx;
332
- return `<Popover>
333
- <PopoverTrigger asChild>
334
- <Button variant="outline" role="combobox">
335
- {selected || "${properties.placeholder || 'Select...'}"}
336
- </Button>
337
- </PopoverTrigger>
338
- <PopoverContent className="w-[200px] p-0">
339
- <Command>
340
- <CommandInput placeholder="${properties.label || 'Search...'}" />
341
- <CommandEmpty>No results found.</CommandEmpty>
342
- <CommandGroup>
343
- {/* Options */}
344
- </CommandGroup>
345
- </Command>
346
- </PopoverContent>
347
- </Popover>`;
348
- },
349
- },
350
-
351
- datepicker: {
352
- imports: [
353
- "import { Calendar } from '@/components/ui/calendar'",
354
- "import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'",
355
- "import { Button } from '@/components/ui/button'",
356
- "import { format } from 'date-fns'",
357
- ],
358
- render: (ctx: RenderContext) => {
359
- const { properties } = ctx;
360
- return `<Popover>
361
- <PopoverTrigger asChild>
362
- <Button variant="outline">
363
- {date ? format(date, "${properties.format || 'PPP'}") : <span>Pick a date</span>}
364
- </Button>
365
- </PopoverTrigger>
366
- <PopoverContent className="w-auto p-0">
367
- <Calendar mode="single" selected={date} onSelect={setDate} initialFocus />
368
- </PopoverContent>
369
- </Popover>`;
370
- },
371
- dependencies: [{ name: 'date-fns', version: '^3.0.0' }],
372
- },
373
-
374
- timepicker: {
375
- imports: ["import { Input } from '@/components/ui/input'", "import { Label } from '@/components/ui/label'"],
376
- render: (ctx: RenderContext) => {
377
- const { properties } = ctx;
378
- return `<div className="grid w-full gap-1.5">
379
- ${properties.label ? `<Label>${properties.label}</Label>` : ''}
380
- <Input type="time" ${properties.required ? 'required' : ''} />
381
- </div>`;
382
- },
383
- },
384
-
385
- // =====================================================================
386
- // ACTIONS (5 types)
387
- // =====================================================================
388
-
389
- button: {
390
- imports: ["import { Button } from '@/components/ui/button'"],
391
- render: (ctx: RenderContext) => {
392
- const { properties } = ctx;
393
- const variants: Record<string, string> = {
394
- primary: 'default',
395
- secondary: 'secondary',
396
- danger: 'destructive',
397
- ghost: 'ghost',
398
- link: 'link',
399
- };
400
- const variant = variants[properties.variant || 'primary'] || 'default';
401
-
402
- return `<Button
403
- variant="${variant}"
404
- size="${properties.size || 'default'}"
405
- ${properties.disabled ? 'disabled' : ''}
406
- ${properties.type ? `type="${properties.type}"` : ''}
407
- >
408
- ${properties.icon ? `<${properties.icon} className="mr-2 h-4 w-4" />` : ''}
409
- ${properties.label || 'Button'}
410
- </Button>`;
411
- },
412
- },
413
-
414
- 'button-group': {
415
- imports: [],
416
- render: (ctx: RenderContext) => {
417
- const { properties, children } = ctx;
418
- const orientation = properties.orientation || 'horizontal';
419
- return `<div className="flex ${orientation === 'vertical' ? 'flex-col' : 'flex-row'} gap-2">
420
- ${children || '/* Buttons */'}
421
- </div>`;
422
- },
423
- },
424
-
425
- link: {
426
- imports: ["import Link from 'next/link'"],
427
- render: (ctx: RenderContext) => {
428
- const { properties } = ctx;
429
- return `<Link
430
- href="${properties.href || '#'}"
431
- className="${properties.underline === false ? 'no-underline' : 'underline'}"
432
- ${properties.external ? 'target="_blank" rel="noopener noreferrer"' : ''}
433
- >
434
- ${properties.label || 'Link'}
435
- </Link>`;
436
- },
437
- },
438
-
439
- icon: {
440
- imports: [],
441
- render: (ctx: RenderContext) => {
442
- const { properties } = ctx;
443
- const sizeMap: Record<string, string> = { small: 'h-4 w-4', medium: 'h-6 w-6', large: 'h-8 w-8' };
444
- const size = sizeMap[properties.size || 'medium'] || 'h-6 w-6';
445
-
446
- return `<${properties.name || 'Icon'} className="${size} ${properties.color ? `text-${properties.color}` : ''}" />`;
447
- },
448
- },
449
-
450
- menu: {
451
- imports: [
452
- "import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'",
453
- ],
454
- render: (ctx: RenderContext) => {
455
- const { children } = ctx;
456
- return `<DropdownMenu>
457
- <DropdownMenuTrigger>Menu</DropdownMenuTrigger>
458
- <DropdownMenuContent>
459
- ${children || '/* Menu items */'}
460
- </DropdownMenuContent>
461
- </DropdownMenu>`;
462
- },
463
- },
464
-
465
- // =====================================================================
466
- // OVERLAYS & FEEDBACK (9 types)
467
- // =====================================================================
468
-
469
- modal: {
470
- imports: [
471
- "import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog'",
472
- ],
473
- render: (ctx: RenderContext) => {
474
- const { properties, children } = ctx;
475
- return `<Dialog open={isOpen} onOpenChange={setIsOpen}>
476
- <DialogContent className="${properties.size === 'small' ? 'sm:max-w-[425px]' : properties.size === 'large' ? 'sm:max-w-[725px]' : 'sm:max-w-[525px]'}">
477
- ${properties.title ? `<DialogHeader>
478
- <DialogTitle>${properties.title}</DialogTitle>
479
- </DialogHeader>` : ''}
480
- <div className="py-4">
481
- ${children || '/* Modal content */'}
482
- </div>
483
- ${properties.footer ? '<DialogFooter>{/* Footer actions */}</DialogFooter>' : ''}
484
- </DialogContent>
485
- </Dialog>`;
486
- },
487
- },
488
-
489
- dialog: {
490
- imports: ["import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from '@/components/ui/alert-dialog'"],
491
- render: (ctx: RenderContext) => {
492
- const { properties } = ctx;
493
- return `<AlertDialog>
494
- <AlertDialogContent>
495
- <AlertDialogHeader>
496
- <AlertDialogTitle>${properties.title || 'Alert'}</AlertDialogTitle>
497
- <AlertDialogDescription>${properties.message || ''}</AlertDialogDescription>
498
- </AlertDialogHeader>
499
- <AlertDialogFooter>
500
- <AlertDialogCancel>Cancel</AlertDialogCancel>
501
- <AlertDialogAction>Continue</AlertDialogAction>
502
- </AlertDialogFooter>
503
- </AlertDialogContent>
504
- </AlertDialog>`;
505
- },
506
- },
507
-
508
- drawer: {
509
- imports: ["import { Sheet, SheetContent, SheetHeader, SheetTitle } from '@/components/ui/sheet'"],
510
- render: (ctx: RenderContext) => {
511
- const { properties, children } = ctx;
512
- return `<Sheet>
513
- <SheetContent side="${properties.position || 'right'}">
514
- <SheetHeader>
515
- <SheetTitle>${properties.title || ''}</SheetTitle>
516
- </SheetHeader>
517
- <div className="py-4">
518
- ${children || '/* Drawer content */'}
519
- </div>
520
- </SheetContent>
521
- </Sheet>`;
522
- },
523
- },
524
-
525
- popover: {
526
- imports: ["import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'"],
527
- render: (ctx: RenderContext) => {
528
- const { children } = ctx;
529
- return `<Popover>
530
- <PopoverTrigger>Trigger</PopoverTrigger>
531
- <PopoverContent>
532
- ${children || 'Popover content'}
533
- </PopoverContent>
534
- </Popover>`;
535
- },
536
- },
537
-
538
- tooltip: {
539
- imports: ["import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'"],
540
- render: (ctx: RenderContext) => {
541
- const { properties } = ctx;
542
- return `<TooltipProvider>
543
- <Tooltip>
544
- <TooltipTrigger>Hover</TooltipTrigger>
545
- <TooltipContent>
546
- <p>${properties.content || 'Tooltip content'}</p>
547
- </TooltipContent>
548
- </Tooltip>
549
- </TooltipProvider>`;
550
- },
551
- },
552
-
553
- alert: {
554
- imports: ["import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'"],
555
- render: (ctx: RenderContext) => {
556
- const { properties } = ctx;
557
- return `<Alert variant="${properties.variant || 'default'}">
558
- ${properties.title ? `<AlertTitle>${properties.title}</AlertTitle>` : ''}
559
- <AlertDescription>${properties.message || ''}</AlertDescription>
560
- </Alert>`;
561
- },
562
- },
563
-
564
- snackbar: {
565
- imports: ["import { useToast } from '@/components/ui/use-toast'"],
566
- render: (ctx: RenderContext) => {
567
- const { properties } = ctx;
568
- return `toast({
569
- title: "${properties.message || 'Notification'}",
570
- duration: ${properties.duration || 3000},
571
- })`;
572
- },
573
- },
574
-
575
- badge: {
576
- imports: ["import { Badge } from '@/components/ui/badge'"],
577
- render: (ctx: RenderContext) => {
578
- const { properties } = ctx;
579
- return `<Badge variant="${properties.variant || 'default'}">${properties.content || ''}</Badge>`;
580
- },
581
- },
582
-
583
- spinner: {
584
- imports: [],
585
- render: (ctx: RenderContext) => {
586
- const { properties } = ctx;
587
- const sizeMap: Record<string, string> = { small: 'h-4 w-4', medium: 'h-8 w-8', large: 'h-12 w-12' };
588
- const size = sizeMap[properties.size || 'medium'] || 'h-8 w-8';
589
- return `<div className="flex items-center justify-center">
590
- <div className="${size} animate-spin rounded-full border-b-2 border-gray-900"></div>
591
- </div>`;
592
- },
593
- },
594
-
595
- // =====================================================================
596
- // NAVIGATION (5 types)
597
- // =====================================================================
598
-
599
- tabs: {
600
- imports: ["import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'"],
601
- render: (ctx: RenderContext) => {
602
- const { properties, children } = ctx;
603
- const sections = properties.sections || ['tab1', 'tab2'];
604
-
605
- return `<Tabs defaultValue="${sections[0]}">
606
- <TabsList>
607
- ${sections.map((section: string) => `<TabsTrigger value="${section}">${section}</TabsTrigger>`).join('\n ')}
608
- </TabsList>
609
- ${sections.map((section: string) => `<TabsContent value="${section}">
610
- {/* ${section} content */}
611
- </TabsContent>`).join('\n ')}
612
- </Tabs>`;
613
- },
614
- },
615
-
616
- breadcrumb: {
617
- imports: [],
618
- render: (ctx: RenderContext) => {
619
- return `<nav className="flex" aria-label="Breadcrumb">
620
- <ol className="inline-flex items-center space-x-1">
621
- {/* Breadcrumb items */}
622
- </ol>
623
- </nav>`;
624
- },
625
- },
626
-
627
- navbar: {
628
- imports: [],
629
- render: (ctx: RenderContext) => {
630
- const { properties, children } = ctx;
631
- return `<nav className="${properties.sticky ? 'sticky top-0' : ''} bg-background border-b">
632
- <div className="container flex h-16 items-center justify-between">
633
- ${children || '/* Navigation items */'}
634
- </div>
635
- </nav>`;
636
- },
637
- },
638
-
639
- sidebar: {
640
- imports: [],
641
- render: (ctx: RenderContext) => {
642
- const { properties, children } = ctx;
643
- return `<aside className="w-${properties.width || 64} border-r ${properties.position === 'right' ? 'order-last' : ''}">
644
- <div className="h-full px-3 py-4">
645
- ${children || '/* Sidebar items */'}
646
- </div>
647
- </aside>`;
648
- },
649
- },
650
-
651
- pagination: {
652
- imports: [
653
- "import { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from '@/components/ui/pagination'",
654
- ],
655
- render: (ctx: RenderContext) => {
656
- return `<Pagination>
657
- <PaginationContent>
658
- <PaginationItem>
659
- <PaginationPrevious href="#" />
660
- </PaginationItem>
661
- {/* Page numbers */}
662
- <PaginationItem>
663
- <PaginationNext href="#" />
664
- </PaginationItem>
665
- </PaginationContent>
666
- </Pagination>`;
667
- },
668
- },
669
-
670
- // =====================================================================
671
- // LAYOUT (6 types)
672
- // =====================================================================
673
-
674
- accordion: {
675
- imports: ["import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@/components/ui/accordion'"],
676
- render: (ctx: RenderContext) => {
677
- const { children } = ctx;
678
- return `<Accordion type="single" collapsible>
679
- ${children || '/* Accordion items */'}
680
- </Accordion>`;
681
- },
682
- },
683
-
684
- carousel: {
685
- imports: [],
686
- render: (ctx: RenderContext) => {
687
- const { children } = ctx;
688
- return `<div className="relative">
689
- {/* Carousel implementation */}
690
- ${children || ''}
691
- </div>`;
692
- },
693
- },
694
-
695
- container: {
696
- imports: [],
697
- render: (ctx: RenderContext) => {
698
- const { properties, children } = ctx;
699
- const layout = properties.layout || 'vertical';
700
- const className = layout === 'horizontal' ? 'flex flex-row' : layout === 'grid' ? 'grid' : 'flex flex-col';
701
-
702
- return `<div className="${className} ${properties.gap ? `gap-${properties.gap}` : ''} ${properties.scrollable ? 'overflow-auto' : ''}">
703
- ${children || '/* Container content */'}
704
- </div>`;
705
- },
706
- },
707
-
708
- divider: {
709
- imports: ["import { Separator } from '@/components/ui/separator'"],
710
- render: (ctx: RenderContext) => {
711
- const { properties } = ctx;
712
- return `<Separator orientation="${properties.orientation || 'horizontal'}" />`;
713
- },
714
- },
715
-
716
- header: {
717
- imports: [],
718
- render: (ctx: RenderContext) => {
719
- const { properties, children } = ctx;
720
- return `<header>
721
- ${properties.title ? `<h1 className="text-3xl font-bold">${properties.title}</h1>` : ''}
722
- ${properties.subtitle ? `<p className="text-muted-foreground">${properties.subtitle}</p>` : ''}
723
- ${children || ''}
724
- </header>`;
725
- },
726
- },
727
-
728
- footer: {
729
- imports: [],
730
- render: (ctx: RenderContext) => {
731
- const { properties, children } = ctx;
732
- return `<footer className="${properties.sticky ? 'sticky bottom-0' : ''} border-t bg-background">
733
- <div className="container py-6">
734
- ${children || '/* Footer content */'}
735
- ${properties.copyright ? `<p className="text-sm text-muted-foreground">${properties.copyright}</p>` : ''}
736
- </div>
737
- </footer>`;
738
- },
739
- },
740
-
741
- // =====================================================================
742
- // PROGRESS (2 types)
743
- // =====================================================================
744
-
745
- 'progress-bar': {
746
- imports: ["import { Progress } from '@/components/ui/progress'"],
747
- render: (ctx: RenderContext) => {
748
- const { properties } = ctx;
749
- return `<div className="space-y-2">
750
- ${properties.label ? `<div className="flex justify-between text-sm"><span>Progress</span><span>{${properties.value || 0}}%</span></div>` : ''}
751
- <Progress value={${properties.value || 0}} max={${properties.max || 100}} />
752
- </div>`;
753
- },
754
- },
755
-
756
- 'progress-circle': {
757
- imports: [],
758
- render: (ctx: RenderContext) => {
759
- const { properties } = ctx;
760
- const size = properties.size === 'large' ? 'h-32 w-32' : properties.size === 'small' ? 'h-16 w-16' : 'h-24 w-24';
761
- return `<div className="${size} relative">
762
- <svg className="rotate-[-90deg]" viewBox="0 0 100 100">
763
- <circle cx="50" cy="50" r="40" stroke="currentColor" strokeWidth="${properties.thickness || 4}" fill="none" className="text-muted" />
764
- <circle cx="50" cy="50" r="40" stroke="currentColor" strokeWidth="${properties.thickness || 4}" fill="none" strokeDasharray="251.2" strokeDashoffset={251.2 - (251.2 * ${properties.value || 0}) / 100} className="text-primary transition-all" />
765
- </svg>
766
- ${properties.label ? '<div className="absolute inset-0 flex items-center justify-center text-lg font-bold">{value}%</div>' : ''}
767
- </div>`;
768
- },
769
- },
770
-
771
- // =====================================================================
772
- // SPECIALIZED (2 types)
773
- // =====================================================================
774
-
775
- searchBar: {
776
- imports: ["import { Input } from '@/components/ui/input'", "import { Search } from 'lucide-react'"],
777
- render: (ctx: RenderContext) => {
778
- const { properties } = ctx;
779
- return `<div className="relative">
780
- <Search className="absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" />
781
- <Input
782
- type="search"
783
- placeholder="${properties.placeholder || 'Search...'}"
784
- className="pl-8"
785
- ${properties.autofocus ? 'autoFocus' : ''}
786
- />
787
- </div>`;
788
- },
789
- },
790
-
791
- filterPanel: {
792
- imports: ["import { Card } from '@/components/ui/card'"],
793
- render: (ctx: RenderContext) => {
794
- const { properties, children } = ctx;
795
- return `<Card className="${properties.position === 'sidebar' ? 'w-64' : 'w-full'} ${properties.collapsible ? 'collapsible' : ''}">
796
- <div className="p-4 space-y-4">
797
- <h3 className="font-semibold">Filters</h3>
798
- ${children || '/* Filter controls */'}
799
- </div>
800
- </Card>`;
801
- },
802
- },
803
- },
804
- };
805
-
806
- export default shadcnAdapter;