@frontmcp/ui 0.5.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 (393) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +438 -0
  3. package/package.json +147 -0
  4. package/src/adapters/index.d.ts +10 -0
  5. package/src/adapters/index.js +18 -0
  6. package/src/adapters/index.js.map +1 -0
  7. package/src/adapters/platform-meta.d.ts +165 -0
  8. package/src/adapters/platform-meta.js +310 -0
  9. package/src/adapters/platform-meta.js.map +1 -0
  10. package/src/base-template/bridge.d.ts +89 -0
  11. package/src/base-template/bridge.js +452 -0
  12. package/src/base-template/bridge.js.map +1 -0
  13. package/src/base-template/default-base-template.d.ts +91 -0
  14. package/src/base-template/default-base-template.js +435 -0
  15. package/src/base-template/default-base-template.js.map +1 -0
  16. package/src/base-template/index.d.ts +14 -0
  17. package/src/base-template/index.js +30 -0
  18. package/src/base-template/index.js.map +1 -0
  19. package/src/base-template/polyfills.d.ts +30 -0
  20. package/src/base-template/polyfills.js +190 -0
  21. package/src/base-template/polyfills.js.map +1 -0
  22. package/src/base-template/theme-styles.d.ts +73 -0
  23. package/src/base-template/theme-styles.js +95 -0
  24. package/src/base-template/theme-styles.js.map +1 -0
  25. package/src/bridge/adapters/base-adapter.d.ts +103 -0
  26. package/src/bridge/adapters/base-adapter.js +314 -0
  27. package/src/bridge/adapters/base-adapter.js.map +1 -0
  28. package/src/bridge/adapters/claude.adapter.d.ts +66 -0
  29. package/src/bridge/adapters/claude.adapter.js +145 -0
  30. package/src/bridge/adapters/claude.adapter.js.map +1 -0
  31. package/src/bridge/adapters/ext-apps.adapter.d.ts +142 -0
  32. package/src/bridge/adapters/ext-apps.adapter.js +416 -0
  33. package/src/bridge/adapters/ext-apps.adapter.js.map +1 -0
  34. package/src/bridge/adapters/gemini.adapter.d.ts +63 -0
  35. package/src/bridge/adapters/gemini.adapter.js +160 -0
  36. package/src/bridge/adapters/gemini.adapter.js.map +1 -0
  37. package/src/bridge/adapters/generic.adapter.d.ts +55 -0
  38. package/src/bridge/adapters/generic.adapter.js +108 -0
  39. package/src/bridge/adapters/generic.adapter.js.map +1 -0
  40. package/src/bridge/adapters/index.d.ts +25 -0
  41. package/src/bridge/adapters/index.js +65 -0
  42. package/src/bridge/adapters/index.js.map +1 -0
  43. package/src/bridge/adapters/openai.adapter.d.ts +64 -0
  44. package/src/bridge/adapters/openai.adapter.js +194 -0
  45. package/src/bridge/adapters/openai.adapter.js.map +1 -0
  46. package/src/bridge/core/adapter-registry.d.ts +121 -0
  47. package/src/bridge/core/adapter-registry.js +271 -0
  48. package/src/bridge/core/adapter-registry.js.map +1 -0
  49. package/src/bridge/core/bridge-factory.d.ts +198 -0
  50. package/src/bridge/core/bridge-factory.js +428 -0
  51. package/src/bridge/core/bridge-factory.js.map +1 -0
  52. package/src/bridge/core/index.d.ts +9 -0
  53. package/src/bridge/core/index.js +22 -0
  54. package/src/bridge/core/index.js.map +1 -0
  55. package/src/bridge/index.d.ts +61 -0
  56. package/src/bridge/index.js +94 -0
  57. package/src/bridge/index.js.map +1 -0
  58. package/src/bridge/runtime/iife-generator.d.ts +61 -0
  59. package/src/bridge/runtime/iife-generator.js +940 -0
  60. package/src/bridge/runtime/iife-generator.js.map +1 -0
  61. package/src/bridge/runtime/index.d.ts +8 -0
  62. package/src/bridge/runtime/index.js +16 -0
  63. package/src/bridge/runtime/index.js.map +1 -0
  64. package/src/bridge/types.d.ts +385 -0
  65. package/src/bridge/types.js +11 -0
  66. package/src/bridge/types.js.map +1 -0
  67. package/src/build/cdn-resources.d.ts +140 -0
  68. package/src/build/cdn-resources.js +314 -0
  69. package/src/build/cdn-resources.js.map +1 -0
  70. package/src/build/index.d.ts +294 -0
  71. package/src/build/index.js +325 -0
  72. package/src/build/index.js.map +1 -0
  73. package/src/build/widget-manifest.d.ts +212 -0
  74. package/src/build/widget-manifest.js +652 -0
  75. package/src/build/widget-manifest.js.map +1 -0
  76. package/src/bundler/bundler.d.ts +110 -0
  77. package/src/bundler/bundler.js +432 -0
  78. package/src/bundler/bundler.js.map +1 -0
  79. package/src/bundler/cache.d.ts +172 -0
  80. package/src/bundler/cache.js +250 -0
  81. package/src/bundler/cache.js.map +1 -0
  82. package/src/bundler/index.d.ts +41 -0
  83. package/src/bundler/index.js +73 -0
  84. package/src/bundler/index.js.map +1 -0
  85. package/src/bundler/sandbox/enclave-adapter.d.ts +120 -0
  86. package/src/bundler/sandbox/enclave-adapter.js +339 -0
  87. package/src/bundler/sandbox/enclave-adapter.js.map +1 -0
  88. package/src/bundler/sandbox/executor.d.ts +13 -0
  89. package/src/bundler/sandbox/executor.js +22 -0
  90. package/src/bundler/sandbox/executor.js.map +1 -0
  91. package/src/bundler/sandbox/policy.d.ts +61 -0
  92. package/src/bundler/sandbox/policy.js +238 -0
  93. package/src/bundler/sandbox/policy.js.map +1 -0
  94. package/src/bundler/types.d.ts +347 -0
  95. package/src/bundler/types.js +132 -0
  96. package/src/bundler/types.js.map +1 -0
  97. package/src/components/alert.d.ts +71 -0
  98. package/src/components/alert.js +189 -0
  99. package/src/components/alert.js.map +1 -0
  100. package/src/components/alert.schema.d.ts +114 -0
  101. package/src/components/alert.schema.js +105 -0
  102. package/src/components/alert.schema.js.map +1 -0
  103. package/src/components/avatar.d.ts +76 -0
  104. package/src/components/avatar.js +176 -0
  105. package/src/components/avatar.js.map +1 -0
  106. package/src/components/avatar.schema.d.ts +169 -0
  107. package/src/components/avatar.schema.js +103 -0
  108. package/src/components/avatar.schema.js.map +1 -0
  109. package/src/components/badge.d.ts +70 -0
  110. package/src/components/badge.js +149 -0
  111. package/src/components/badge.js.map +1 -0
  112. package/src/components/badge.schema.d.ts +109 -0
  113. package/src/components/badge.schema.js +96 -0
  114. package/src/components/badge.schema.js.map +1 -0
  115. package/src/components/button.d.ts +111 -0
  116. package/src/components/button.js +336 -0
  117. package/src/components/button.js.map +1 -0
  118. package/src/components/button.schema.d.ts +148 -0
  119. package/src/components/button.schema.js +121 -0
  120. package/src/components/button.schema.js.map +1 -0
  121. package/src/components/card.d.ts +60 -0
  122. package/src/components/card.js +117 -0
  123. package/src/components/card.js.map +1 -0
  124. package/src/components/card.schema.d.ts +113 -0
  125. package/src/components/card.schema.js +98 -0
  126. package/src/components/card.schema.js.map +1 -0
  127. package/src/components/form.d.ts +239 -0
  128. package/src/components/form.js +420 -0
  129. package/src/components/form.js.map +1 -0
  130. package/src/components/form.schema.d.ts +441 -0
  131. package/src/components/form.schema.js +406 -0
  132. package/src/components/form.schema.js.map +1 -0
  133. package/src/components/index.d.ts +29 -0
  134. package/src/components/index.js +98 -0
  135. package/src/components/index.js.map +1 -0
  136. package/src/components/list.d.ts +127 -0
  137. package/src/components/list.js +279 -0
  138. package/src/components/list.js.map +1 -0
  139. package/src/components/list.schema.d.ts +134 -0
  140. package/src/components/list.schema.js +168 -0
  141. package/src/components/list.schema.js.map +1 -0
  142. package/src/components/modal.d.ts +111 -0
  143. package/src/components/modal.js +260 -0
  144. package/src/components/modal.js.map +1 -0
  145. package/src/components/modal.schema.d.ts +186 -0
  146. package/src/components/modal.schema.js +167 -0
  147. package/src/components/modal.schema.js.map +1 -0
  148. package/src/components/table.d.ts +105 -0
  149. package/src/components/table.js +283 -0
  150. package/src/components/table.js.map +1 -0
  151. package/src/components/table.schema.d.ts +159 -0
  152. package/src/components/table.schema.js +173 -0
  153. package/src/components/table.schema.js.map +1 -0
  154. package/src/handlebars/helpers.d.ts +348 -0
  155. package/src/handlebars/helpers.js +605 -0
  156. package/src/handlebars/helpers.js.map +1 -0
  157. package/src/handlebars/index.d.ts +193 -0
  158. package/src/handlebars/index.js +350 -0
  159. package/src/handlebars/index.js.map +1 -0
  160. package/src/index.d.ts +50 -0
  161. package/src/index.js +192 -0
  162. package/src/index.js.map +1 -0
  163. package/src/layouts/base.d.ts +88 -0
  164. package/src/layouts/base.js +227 -0
  165. package/src/layouts/base.js.map +1 -0
  166. package/src/layouts/index.d.ts +7 -0
  167. package/src/layouts/index.js +25 -0
  168. package/src/layouts/index.js.map +1 -0
  169. package/src/layouts/presets.d.ts +133 -0
  170. package/src/layouts/presets.js +277 -0
  171. package/src/layouts/presets.js.map +1 -0
  172. package/src/pages/consent.d.ts +116 -0
  173. package/src/pages/consent.js +218 -0
  174. package/src/pages/consent.js.map +1 -0
  175. package/src/pages/error.d.ts +100 -0
  176. package/src/pages/error.js +263 -0
  177. package/src/pages/error.js.map +1 -0
  178. package/src/pages/index.d.ts +8 -0
  179. package/src/pages/index.js +27 -0
  180. package/src/pages/index.js.map +1 -0
  181. package/src/react/Alert.d.ts +101 -0
  182. package/src/react/Alert.js +51 -0
  183. package/src/react/Alert.js.map +1 -0
  184. package/src/react/Badge.d.ts +100 -0
  185. package/src/react/Badge.js +55 -0
  186. package/src/react/Badge.js.map +1 -0
  187. package/src/react/Button.d.ts +108 -0
  188. package/src/react/Button.js +52 -0
  189. package/src/react/Button.js.map +1 -0
  190. package/src/react/Card.d.ts +103 -0
  191. package/src/react/Card.js +55 -0
  192. package/src/react/Card.js.map +1 -0
  193. package/src/react/hooks/context.d.ts +178 -0
  194. package/src/react/hooks/context.js +287 -0
  195. package/src/react/hooks/context.js.map +1 -0
  196. package/src/react/hooks/index.d.ts +41 -0
  197. package/src/react/hooks/index.js +61 -0
  198. package/src/react/hooks/index.js.map +1 -0
  199. package/src/react/hooks/tools.d.ts +283 -0
  200. package/src/react/hooks/tools.js +465 -0
  201. package/src/react/hooks/tools.js.map +1 -0
  202. package/src/react/index.d.ts +80 -0
  203. package/src/react/index.js +113 -0
  204. package/src/react/index.js.map +1 -0
  205. package/src/react/types.d.ts +105 -0
  206. package/src/react/types.js +12 -0
  207. package/src/react/types.js.map +1 -0
  208. package/src/react/utils.d.ts +42 -0
  209. package/src/react/utils.js +99 -0
  210. package/src/react/utils.js.map +1 -0
  211. package/src/registry/index.d.ts +45 -0
  212. package/src/registry/index.js +67 -0
  213. package/src/registry/index.js.map +1 -0
  214. package/src/registry/render-template.d.ts +86 -0
  215. package/src/registry/render-template.js +239 -0
  216. package/src/registry/render-template.js.map +1 -0
  217. package/src/registry/tool-ui.registry.d.ts +260 -0
  218. package/src/registry/tool-ui.registry.js +438 -0
  219. package/src/registry/tool-ui.registry.js.map +1 -0
  220. package/src/registry/uri-utils.d.ts +55 -0
  221. package/src/registry/uri-utils.js +97 -0
  222. package/src/registry/uri-utils.js.map +1 -0
  223. package/src/render/index.d.ts +7 -0
  224. package/src/render/index.js +14 -0
  225. package/src/render/index.js.map +1 -0
  226. package/src/render/prerender.d.ts +56 -0
  227. package/src/render/prerender.js +98 -0
  228. package/src/render/prerender.js.map +1 -0
  229. package/src/renderers/cache.d.ts +144 -0
  230. package/src/renderers/cache.js +240 -0
  231. package/src/renderers/cache.js.map +1 -0
  232. package/src/renderers/html.renderer.d.ts +122 -0
  233. package/src/renderers/html.renderer.js +204 -0
  234. package/src/renderers/html.renderer.js.map +1 -0
  235. package/src/renderers/index.d.ts +35 -0
  236. package/src/renderers/index.js +70 -0
  237. package/src/renderers/index.js.map +1 -0
  238. package/src/renderers/mdx.renderer.d.ts +119 -0
  239. package/src/renderers/mdx.renderer.js +305 -0
  240. package/src/renderers/mdx.renderer.js.map +1 -0
  241. package/src/renderers/react.renderer.d.ts +95 -0
  242. package/src/renderers/react.renderer.js +260 -0
  243. package/src/renderers/react.renderer.js.map +1 -0
  244. package/src/renderers/registry.d.ts +133 -0
  245. package/src/renderers/registry.js +232 -0
  246. package/src/renderers/registry.js.map +1 -0
  247. package/src/renderers/types.d.ts +341 -0
  248. package/src/renderers/types.js +9 -0
  249. package/src/renderers/types.js.map +1 -0
  250. package/src/renderers/utils/detect.d.ts +106 -0
  251. package/src/renderers/utils/detect.js +267 -0
  252. package/src/renderers/utils/detect.js.map +1 -0
  253. package/src/renderers/utils/hash.d.ts +39 -0
  254. package/src/renderers/utils/hash.js +75 -0
  255. package/src/renderers/utils/hash.js.map +1 -0
  256. package/src/renderers/utils/index.d.ts +8 -0
  257. package/src/renderers/utils/index.js +28 -0
  258. package/src/renderers/utils/index.js.map +1 -0
  259. package/src/renderers/utils/transpiler.d.ts +88 -0
  260. package/src/renderers/utils/transpiler.js +215 -0
  261. package/src/renderers/utils/transpiler.js.map +1 -0
  262. package/src/runtime/adapters/html.adapter.d.ts +58 -0
  263. package/src/runtime/adapters/html.adapter.js +131 -0
  264. package/src/runtime/adapters/html.adapter.js.map +1 -0
  265. package/src/runtime/adapters/index.d.ts +25 -0
  266. package/src/runtime/adapters/index.js +54 -0
  267. package/src/runtime/adapters/index.js.map +1 -0
  268. package/src/runtime/adapters/mdx.adapter.d.ts +72 -0
  269. package/src/runtime/adapters/mdx.adapter.js +241 -0
  270. package/src/runtime/adapters/mdx.adapter.js.map +1 -0
  271. package/src/runtime/adapters/react.adapter.d.ts +69 -0
  272. package/src/runtime/adapters/react.adapter.js +245 -0
  273. package/src/runtime/adapters/react.adapter.js.map +1 -0
  274. package/src/runtime/adapters/types.d.ts +94 -0
  275. package/src/runtime/adapters/types.js +11 -0
  276. package/src/runtime/adapters/types.js.map +1 -0
  277. package/src/runtime/csp.d.ts +37 -0
  278. package/src/runtime/csp.js +140 -0
  279. package/src/runtime/csp.js.map +1 -0
  280. package/src/runtime/index.d.ts +16 -0
  281. package/src/runtime/index.js +72 -0
  282. package/src/runtime/index.js.map +1 -0
  283. package/src/runtime/mcp-bridge.d.ts +100 -0
  284. package/src/runtime/mcp-bridge.js +581 -0
  285. package/src/runtime/mcp-bridge.js.map +1 -0
  286. package/src/runtime/renderer-runtime.d.ts +132 -0
  287. package/src/runtime/renderer-runtime.js +389 -0
  288. package/src/runtime/renderer-runtime.js.map +1 -0
  289. package/src/runtime/sanitizer.d.ts +171 -0
  290. package/src/runtime/sanitizer.js +318 -0
  291. package/src/runtime/sanitizer.js.map +1 -0
  292. package/src/runtime/types.d.ts +414 -0
  293. package/src/runtime/types.js +12 -0
  294. package/src/runtime/types.js.map +1 -0
  295. package/src/runtime/wrapper.d.ts +375 -0
  296. package/src/runtime/wrapper.js +1793 -0
  297. package/src/runtime/wrapper.js.map +1 -0
  298. package/src/styles/index.d.ts +7 -0
  299. package/src/styles/index.js +11 -0
  300. package/src/styles/index.js.map +1 -0
  301. package/src/styles/variants.d.ts +50 -0
  302. package/src/styles/variants.js +175 -0
  303. package/src/styles/variants.js.map +1 -0
  304. package/src/theme/cdn.d.ts +194 -0
  305. package/src/theme/cdn.js +375 -0
  306. package/src/theme/cdn.js.map +1 -0
  307. package/src/theme/index.d.ts +17 -0
  308. package/src/theme/index.js +57 -0
  309. package/src/theme/index.js.map +1 -0
  310. package/src/theme/platforms.d.ts +106 -0
  311. package/src/theme/platforms.js +161 -0
  312. package/src/theme/platforms.js.map +1 -0
  313. package/src/theme/presets/github-openai.d.ts +49 -0
  314. package/src/theme/presets/github-openai.js +189 -0
  315. package/src/theme/presets/github-openai.js.map +1 -0
  316. package/src/theme/presets/index.d.ts +10 -0
  317. package/src/theme/presets/index.js +17 -0
  318. package/src/theme/presets/index.js.map +1 -0
  319. package/src/theme/theme.d.ts +395 -0
  320. package/src/theme/theme.js +332 -0
  321. package/src/theme/theme.js.map +1 -0
  322. package/src/tool-template/builder.d.ts +212 -0
  323. package/src/tool-template/builder.js +397 -0
  324. package/src/tool-template/builder.js.map +1 -0
  325. package/src/tool-template/index.d.ts +15 -0
  326. package/src/tool-template/index.js +38 -0
  327. package/src/tool-template/index.js.map +1 -0
  328. package/src/types/index.d.ts +13 -0
  329. package/src/types/index.js +26 -0
  330. package/src/types/index.js.map +1 -0
  331. package/src/types/ui-config.d.ts +357 -0
  332. package/src/types/ui-config.js +12 -0
  333. package/src/types/ui-config.js.map +1 -0
  334. package/src/types/ui-runtime.d.ts +965 -0
  335. package/src/types/ui-runtime.js +117 -0
  336. package/src/types/ui-runtime.js.map +1 -0
  337. package/src/validation/error-box.d.ts +55 -0
  338. package/src/validation/error-box.js +75 -0
  339. package/src/validation/error-box.js.map +1 -0
  340. package/src/validation/index.d.ts +12 -0
  341. package/src/validation/index.js +21 -0
  342. package/src/validation/index.js.map +1 -0
  343. package/src/validation/wrapper.d.ts +96 -0
  344. package/src/validation/wrapper.js +117 -0
  345. package/src/validation/wrapper.js.map +1 -0
  346. package/src/web-components/core/attribute-parser.d.ts +85 -0
  347. package/src/web-components/core/attribute-parser.js +189 -0
  348. package/src/web-components/core/attribute-parser.js.map +1 -0
  349. package/src/web-components/core/base-element.d.ts +197 -0
  350. package/src/web-components/core/base-element.js +289 -0
  351. package/src/web-components/core/base-element.js.map +1 -0
  352. package/src/web-components/core/index.d.ts +8 -0
  353. package/src/web-components/core/index.js +18 -0
  354. package/src/web-components/core/index.js.map +1 -0
  355. package/src/web-components/elements/fmcp-alert.d.ts +45 -0
  356. package/src/web-components/elements/fmcp-alert.js +93 -0
  357. package/src/web-components/elements/fmcp-alert.js.map +1 -0
  358. package/src/web-components/elements/fmcp-badge.d.ts +46 -0
  359. package/src/web-components/elements/fmcp-badge.js +99 -0
  360. package/src/web-components/elements/fmcp-badge.js.map +1 -0
  361. package/src/web-components/elements/fmcp-button.d.ts +124 -0
  362. package/src/web-components/elements/fmcp-button.js +233 -0
  363. package/src/web-components/elements/fmcp-button.js.map +1 -0
  364. package/src/web-components/elements/fmcp-card.d.ts +52 -0
  365. package/src/web-components/elements/fmcp-card.js +115 -0
  366. package/src/web-components/elements/fmcp-card.js.map +1 -0
  367. package/src/web-components/elements/fmcp-input.d.ts +95 -0
  368. package/src/web-components/elements/fmcp-input.js +248 -0
  369. package/src/web-components/elements/fmcp-input.js.map +1 -0
  370. package/src/web-components/elements/fmcp-select.d.ts +99 -0
  371. package/src/web-components/elements/fmcp-select.js +243 -0
  372. package/src/web-components/elements/fmcp-select.js.map +1 -0
  373. package/src/web-components/elements/index.d.ts +12 -0
  374. package/src/web-components/elements/index.js +34 -0
  375. package/src/web-components/elements/index.js.map +1 -0
  376. package/src/web-components/index.d.ts +49 -0
  377. package/src/web-components/index.js +75 -0
  378. package/src/web-components/index.js.map +1 -0
  379. package/src/web-components/register.d.ts +56 -0
  380. package/src/web-components/register.js +80 -0
  381. package/src/web-components/register.js.map +1 -0
  382. package/src/web-components/types.d.ts +121 -0
  383. package/src/web-components/types.js +25 -0
  384. package/src/web-components/types.js.map +1 -0
  385. package/src/widgets/index.d.ts +7 -0
  386. package/src/widgets/index.js +24 -0
  387. package/src/widgets/index.js.map +1 -0
  388. package/src/widgets/progress.d.ts +132 -0
  389. package/src/widgets/progress.js +303 -0
  390. package/src/widgets/progress.js.map +1 -0
  391. package/src/widgets/resource.d.ts +162 -0
  392. package/src/widgets/resource.js +340 -0
  393. package/src/widgets/resource.js.map +1 -0
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ /**
3
+ * @file index.ts
4
+ * @description Theme Module for FrontMCP UI.
5
+ *
6
+ * Provides comprehensive theming capabilities including:
7
+ * - Color palettes and semantic tokens
8
+ * - Typography and spacing configuration
9
+ * - CDN resource customization
10
+ * - Platform-specific configurations
11
+ * - Theme presets (GitHub/OpenAI default)
12
+ *
13
+ * @module @frontmcp/ui/theme
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.DEFAULT_THEME = exports.GITHUB_OPENAI_THEME = exports.buildStyleBlock = exports.buildThemeCss = exports.createTheme = exports.mergeThemes = exports.getFallbackMode = exports.supportsFullInteractivity = exports.needsInlineScripts = exports.canUseCdn = exports.createPlatform = exports.getPlatform = exports.PLATFORM_PRESETS = exports.CUSTOM_PLATFORM = exports.NGROK_PLATFORM = exports.GEMINI_PLATFORM = exports.CLAUDE_PLATFORM = exports.OPENAI_PLATFORM = exports.buildCdnScriptsFromTheme = exports.buildCdnScripts = exports.buildFontStylesheetsFromTheme = exports.buildFontStylesheets = exports.buildFontPreconnectFromTheme = exports.buildFontPreconnect = exports.clearScriptCache = exports.isScriptCached = exports.getCachedScript = exports.fetchAndCacheScriptsFromTheme = exports.fetchAndCacheScripts = exports.fetchScript = exports.CDN = void 0;
17
+ // CDN configuration
18
+ var cdn_1 = require("./cdn");
19
+ Object.defineProperty(exports, "CDN", { enumerable: true, get: function () { return cdn_1.CDN; } });
20
+ Object.defineProperty(exports, "fetchScript", { enumerable: true, get: function () { return cdn_1.fetchScript; } });
21
+ Object.defineProperty(exports, "fetchAndCacheScripts", { enumerable: true, get: function () { return cdn_1.fetchAndCacheScripts; } });
22
+ Object.defineProperty(exports, "fetchAndCacheScriptsFromTheme", { enumerable: true, get: function () { return cdn_1.fetchAndCacheScriptsFromTheme; } });
23
+ Object.defineProperty(exports, "getCachedScript", { enumerable: true, get: function () { return cdn_1.getCachedScript; } });
24
+ Object.defineProperty(exports, "isScriptCached", { enumerable: true, get: function () { return cdn_1.isScriptCached; } });
25
+ Object.defineProperty(exports, "clearScriptCache", { enumerable: true, get: function () { return cdn_1.clearScriptCache; } });
26
+ Object.defineProperty(exports, "buildFontPreconnect", { enumerable: true, get: function () { return cdn_1.buildFontPreconnect; } });
27
+ Object.defineProperty(exports, "buildFontPreconnectFromTheme", { enumerable: true, get: function () { return cdn_1.buildFontPreconnectFromTheme; } });
28
+ Object.defineProperty(exports, "buildFontStylesheets", { enumerable: true, get: function () { return cdn_1.buildFontStylesheets; } });
29
+ Object.defineProperty(exports, "buildFontStylesheetsFromTheme", { enumerable: true, get: function () { return cdn_1.buildFontStylesheetsFromTheme; } });
30
+ Object.defineProperty(exports, "buildCdnScripts", { enumerable: true, get: function () { return cdn_1.buildCdnScripts; } });
31
+ Object.defineProperty(exports, "buildCdnScriptsFromTheme", { enumerable: true, get: function () { return cdn_1.buildCdnScriptsFromTheme; } });
32
+ // Platform configurations
33
+ var platforms_1 = require("./platforms");
34
+ Object.defineProperty(exports, "OPENAI_PLATFORM", { enumerable: true, get: function () { return platforms_1.OPENAI_PLATFORM; } });
35
+ Object.defineProperty(exports, "CLAUDE_PLATFORM", { enumerable: true, get: function () { return platforms_1.CLAUDE_PLATFORM; } });
36
+ Object.defineProperty(exports, "GEMINI_PLATFORM", { enumerable: true, get: function () { return platforms_1.GEMINI_PLATFORM; } });
37
+ Object.defineProperty(exports, "NGROK_PLATFORM", { enumerable: true, get: function () { return platforms_1.NGROK_PLATFORM; } });
38
+ Object.defineProperty(exports, "CUSTOM_PLATFORM", { enumerable: true, get: function () { return platforms_1.CUSTOM_PLATFORM; } });
39
+ Object.defineProperty(exports, "PLATFORM_PRESETS", { enumerable: true, get: function () { return platforms_1.PLATFORM_PRESETS; } });
40
+ Object.defineProperty(exports, "getPlatform", { enumerable: true, get: function () { return platforms_1.getPlatform; } });
41
+ Object.defineProperty(exports, "createPlatform", { enumerable: true, get: function () { return platforms_1.createPlatform; } });
42
+ Object.defineProperty(exports, "canUseCdn", { enumerable: true, get: function () { return platforms_1.canUseCdn; } });
43
+ Object.defineProperty(exports, "needsInlineScripts", { enumerable: true, get: function () { return platforms_1.needsInlineScripts; } });
44
+ Object.defineProperty(exports, "supportsFullInteractivity", { enumerable: true, get: function () { return platforms_1.supportsFullInteractivity; } });
45
+ Object.defineProperty(exports, "getFallbackMode", { enumerable: true, get: function () { return platforms_1.getFallbackMode; } });
46
+ // Theme configuration and types
47
+ var theme_1 = require("./theme");
48
+ // Theme utilities
49
+ Object.defineProperty(exports, "mergeThemes", { enumerable: true, get: function () { return theme_1.mergeThemes; } });
50
+ Object.defineProperty(exports, "createTheme", { enumerable: true, get: function () { return theme_1.createTheme; } });
51
+ Object.defineProperty(exports, "buildThemeCss", { enumerable: true, get: function () { return theme_1.buildThemeCss; } });
52
+ Object.defineProperty(exports, "buildStyleBlock", { enumerable: true, get: function () { return theme_1.buildStyleBlock; } });
53
+ // Theme presets (includes DEFAULT_THEME)
54
+ var presets_1 = require("./presets");
55
+ Object.defineProperty(exports, "GITHUB_OPENAI_THEME", { enumerable: true, get: function () { return presets_1.GITHUB_OPENAI_THEME; } });
56
+ Object.defineProperty(exports, "DEFAULT_THEME", { enumerable: true, get: function () { return presets_1.DEFAULT_THEME; } });
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/theme/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,oBAAoB;AACpB,6BAgBe;AAfb,0FAAA,GAAG,OAAA;AAGH,kGAAA,WAAW,OAAA;AACX,2GAAA,oBAAoB,OAAA;AACpB,oHAAA,6BAA6B,OAAA;AAC7B,sGAAA,eAAe,OAAA;AACf,qGAAA,cAAc,OAAA;AACd,uGAAA,gBAAgB,OAAA;AAChB,0GAAA,mBAAmB,OAAA;AACnB,mHAAA,4BAA4B,OAAA;AAC5B,2GAAA,oBAAoB,OAAA;AACpB,oHAAA,6BAA6B,OAAA;AAC7B,sGAAA,eAAe,OAAA;AACf,+GAAA,wBAAwB,OAAA;AAG1B,0BAA0B;AAC1B,yCAiBqB;AAZnB,4GAAA,eAAe,OAAA;AACf,4GAAA,eAAe,OAAA;AACf,4GAAA,eAAe,OAAA;AACf,2GAAA,cAAc,OAAA;AACd,4GAAA,eAAe,OAAA;AACf,6GAAA,gBAAgB,OAAA;AAChB,wGAAA,WAAW,OAAA;AACX,2GAAA,cAAc,OAAA;AACd,sGAAA,SAAS,OAAA;AACT,+GAAA,kBAAkB,OAAA;AAClB,sHAAA,yBAAyB,OAAA;AACzB,4GAAA,eAAe,OAAA;AAGjB,gCAAgC;AAChC,iCAqCiB;AALf,kBAAkB;AAClB,oGAAA,WAAW,OAAA;AACX,oGAAA,WAAW,OAAA;AACX,sGAAA,aAAa,OAAA;AACb,wGAAA,eAAe,OAAA;AAGjB,yCAAyC;AACzC,qCAA+D;AAAtD,8GAAA,mBAAmB,OAAA;AAAE,wGAAA,aAAa,OAAA","sourcesContent":["/**\n * @file index.ts\n * @description Theme Module for FrontMCP UI.\n *\n * Provides comprehensive theming capabilities including:\n * - Color palettes and semantic tokens\n * - Typography and spacing configuration\n * - CDN resource customization\n * - Platform-specific configurations\n * - Theme presets (GitHub/OpenAI default)\n *\n * @module @frontmcp/ui/theme\n */\n\n// CDN configuration\nexport {\n CDN,\n type CdnScriptOptions,\n type ThemeCdnScriptOptions,\n fetchScript,\n fetchAndCacheScripts,\n fetchAndCacheScriptsFromTheme,\n getCachedScript,\n isScriptCached,\n clearScriptCache,\n buildFontPreconnect,\n buildFontPreconnectFromTheme,\n buildFontStylesheets,\n buildFontStylesheetsFromTheme,\n buildCdnScripts,\n buildCdnScriptsFromTheme,\n} from './cdn';\n\n// Platform configurations\nexport {\n type PlatformId,\n type NetworkMode,\n type ScriptStrategy,\n type PlatformCapabilities,\n OPENAI_PLATFORM,\n CLAUDE_PLATFORM,\n GEMINI_PLATFORM,\n NGROK_PLATFORM,\n CUSTOM_PLATFORM,\n PLATFORM_PRESETS,\n getPlatform,\n createPlatform,\n canUseCdn,\n needsInlineScripts,\n supportsFullInteractivity,\n getFallbackMode,\n} from './platforms';\n\n// Theme configuration and types\nexport {\n // Utility types\n type DeepPartial,\n // Color types\n type ColorScale,\n type SemanticColors,\n type SurfaceColors,\n type TextColors,\n type BorderColors,\n type ThemeColors,\n // Typography types\n type FontFamilies,\n type FontSizes,\n type FontWeights,\n type ThemeTypography,\n // Spacing types\n type ThemeSpacing,\n type ThemeRadius,\n type ThemeShadows,\n // Component tokens\n type ButtonTokens,\n type CardTokens,\n type InputTokens,\n type ComponentTokens,\n // CDN configuration types\n type CdnScriptResource,\n type ThemeCdnFonts,\n type ThemeCdnIcons,\n type ThemeCdnScripts,\n type ThemeCdnConfig,\n // Main theme config\n type ThemeConfig,\n // Theme utilities\n mergeThemes,\n createTheme,\n buildThemeCss,\n buildStyleBlock,\n} from './theme';\n\n// Theme presets (includes DEFAULT_THEME)\nexport { GITHUB_OPENAI_THEME, DEFAULT_THEME } from './presets';\n"]}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * LLM Platform Configurations
3
+ *
4
+ * Different LLM platforms have different capabilities for rendering UI:
5
+ * - OpenAI: Full support (Canvas/Apps SDK) - Tailwind + HTMX with network
6
+ * - Claude: Artifacts mode - Tailwind but NO network (scripts must be inlined)
7
+ * - Gemini: No interactive widget support
8
+ * - Custom MCP: Configurable based on client capabilities
9
+ *
10
+ * This module provides platform presets and utilities for building
11
+ * compatible UI across different environments.
12
+ */
13
+ /**
14
+ * Known LLM platform identifiers
15
+ */
16
+ export type PlatformId = 'openai' | 'claude' | 'gemini' | 'ngrok' | 'custom';
17
+ /**
18
+ * Network access mode for the platform
19
+ */
20
+ export type NetworkMode = 'full' | 'blocked' | 'limited';
21
+ /**
22
+ * Script loading strategy
23
+ */
24
+ export type ScriptStrategy = 'cdn' | 'inline' | 'cached';
25
+ /**
26
+ * Platform capabilities configuration
27
+ */
28
+ export interface PlatformCapabilities {
29
+ /** Platform identifier */
30
+ id: PlatformId;
31
+ /** Human-readable name */
32
+ name: string;
33
+ /** Whether platform supports interactive widgets */
34
+ supportsWidgets: boolean;
35
+ /** Whether platform supports Tailwind CSS */
36
+ supportsTailwind: boolean;
37
+ /** Whether platform supports HTMX/dynamic content */
38
+ supportsHtmx: boolean;
39
+ /** Network access mode */
40
+ networkMode: NetworkMode;
41
+ /** How to load scripts */
42
+ scriptStrategy: ScriptStrategy;
43
+ /** Allowed domains for network requests (if limited) */
44
+ allowedDomains?: string[];
45
+ /** Content Security Policy restrictions */
46
+ cspRestrictions?: string[];
47
+ /** Maximum inline script size (bytes) */
48
+ maxInlineSize?: number;
49
+ /** Additional platform-specific options */
50
+ options?: Record<string, unknown>;
51
+ }
52
+ /**
53
+ * OpenAI Platform Configuration
54
+ * Full support via Canvas/Apps SDK
55
+ */
56
+ export declare const OPENAI_PLATFORM: PlatformCapabilities;
57
+ /**
58
+ * Claude Platform Configuration
59
+ * Artifacts mode - no network access, must inline scripts
60
+ */
61
+ export declare const CLAUDE_PLATFORM: PlatformCapabilities;
62
+ /**
63
+ * Gemini Platform Configuration
64
+ * No interactive widget support
65
+ */
66
+ export declare const GEMINI_PLATFORM: PlatformCapabilities;
67
+ /**
68
+ * Ngrok Platform Configuration
69
+ * Bridge/tunnel - essential for HTMX
70
+ */
71
+ export declare const NGROK_PLATFORM: PlatformCapabilities;
72
+ /**
73
+ * Default custom MCP client configuration
74
+ */
75
+ export declare const CUSTOM_PLATFORM: PlatformCapabilities;
76
+ /**
77
+ * All platform presets
78
+ */
79
+ export declare const PLATFORM_PRESETS: Record<PlatformId, PlatformCapabilities>;
80
+ /**
81
+ * Get platform capabilities by ID
82
+ */
83
+ export declare function getPlatform(id: PlatformId): PlatformCapabilities;
84
+ /**
85
+ * Create custom platform configuration
86
+ */
87
+ export declare function createPlatform(base: Partial<PlatformCapabilities> & {
88
+ id: PlatformId;
89
+ name: string;
90
+ }): PlatformCapabilities;
91
+ /**
92
+ * Check if platform can use CDN resources
93
+ */
94
+ export declare function canUseCdn(platform: PlatformCapabilities): boolean;
95
+ /**
96
+ * Check if platform needs inlined scripts
97
+ */
98
+ export declare function needsInlineScripts(platform: PlatformCapabilities): boolean;
99
+ /**
100
+ * Check if platform supports full interactivity
101
+ */
102
+ export declare function supportsFullInteractivity(platform: PlatformCapabilities): boolean;
103
+ /**
104
+ * Get fallback rendering mode for unsupported platforms
105
+ */
106
+ export declare function getFallbackMode(platform: PlatformCapabilities): 'html' | 'markdown' | 'text';
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ /**
3
+ * LLM Platform Configurations
4
+ *
5
+ * Different LLM platforms have different capabilities for rendering UI:
6
+ * - OpenAI: Full support (Canvas/Apps SDK) - Tailwind + HTMX with network
7
+ * - Claude: Artifacts mode - Tailwind but NO network (scripts must be inlined)
8
+ * - Gemini: No interactive widget support
9
+ * - Custom MCP: Configurable based on client capabilities
10
+ *
11
+ * This module provides platform presets and utilities for building
12
+ * compatible UI across different environments.
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.PLATFORM_PRESETS = exports.CUSTOM_PLATFORM = exports.NGROK_PLATFORM = exports.GEMINI_PLATFORM = exports.CLAUDE_PLATFORM = exports.OPENAI_PLATFORM = void 0;
16
+ exports.getPlatform = getPlatform;
17
+ exports.createPlatform = createPlatform;
18
+ exports.canUseCdn = canUseCdn;
19
+ exports.needsInlineScripts = needsInlineScripts;
20
+ exports.supportsFullInteractivity = supportsFullInteractivity;
21
+ exports.getFallbackMode = getFallbackMode;
22
+ // ============================================
23
+ // Platform Presets
24
+ // ============================================
25
+ /**
26
+ * OpenAI Platform Configuration
27
+ * Full support via Canvas/Apps SDK
28
+ */
29
+ exports.OPENAI_PLATFORM = {
30
+ id: 'openai',
31
+ name: 'OpenAI',
32
+ supportsWidgets: true,
33
+ supportsTailwind: true,
34
+ supportsHtmx: true,
35
+ networkMode: 'full',
36
+ scriptStrategy: 'cdn',
37
+ options: {
38
+ sdk: 'apps-sdk',
39
+ version: '1.0',
40
+ },
41
+ };
42
+ /**
43
+ * Claude Platform Configuration
44
+ * Artifacts mode - no network access, must inline scripts
45
+ */
46
+ exports.CLAUDE_PLATFORM = {
47
+ id: 'claude',
48
+ name: 'Claude (Artifacts)',
49
+ supportsWidgets: true,
50
+ supportsTailwind: true,
51
+ supportsHtmx: false, // Network blocked, HTMX won't work for API calls
52
+ networkMode: 'blocked',
53
+ scriptStrategy: 'inline',
54
+ maxInlineSize: 100 * 1024, // 100KB limit for artifacts
55
+ cspRestrictions: ["script-src 'unsafe-inline'", "connect-src 'none'"],
56
+ options: {
57
+ mode: 'artifacts',
58
+ framework: 'react', // Claude artifacts prefer React
59
+ },
60
+ };
61
+ /**
62
+ * Gemini Platform Configuration
63
+ * No interactive widget support
64
+ */
65
+ exports.GEMINI_PLATFORM = {
66
+ id: 'gemini',
67
+ name: 'Gemini',
68
+ supportsWidgets: false,
69
+ supportsTailwind: false,
70
+ supportsHtmx: false,
71
+ networkMode: 'blocked',
72
+ scriptStrategy: 'inline',
73
+ options: {
74
+ fallback: 'markdown', // Fall back to markdown rendering
75
+ },
76
+ };
77
+ /**
78
+ * Ngrok Platform Configuration
79
+ * Bridge/tunnel - essential for HTMX
80
+ */
81
+ exports.NGROK_PLATFORM = {
82
+ id: 'ngrok',
83
+ name: 'Ngrok Tunnel',
84
+ supportsWidgets: true,
85
+ supportsTailwind: true,
86
+ supportsHtmx: true,
87
+ networkMode: 'full',
88
+ scriptStrategy: 'cdn',
89
+ options: {
90
+ tunnelRequired: true,
91
+ },
92
+ };
93
+ /**
94
+ * Default custom MCP client configuration
95
+ */
96
+ exports.CUSTOM_PLATFORM = {
97
+ id: 'custom',
98
+ name: 'Custom MCP Client',
99
+ supportsWidgets: true,
100
+ supportsTailwind: true,
101
+ supportsHtmx: true,
102
+ networkMode: 'full',
103
+ scriptStrategy: 'cdn',
104
+ };
105
+ /**
106
+ * All platform presets
107
+ */
108
+ exports.PLATFORM_PRESETS = {
109
+ openai: exports.OPENAI_PLATFORM,
110
+ claude: exports.CLAUDE_PLATFORM,
111
+ gemini: exports.GEMINI_PLATFORM,
112
+ ngrok: exports.NGROK_PLATFORM,
113
+ custom: exports.CUSTOM_PLATFORM,
114
+ };
115
+ // ============================================
116
+ // Platform Detection & Utilities
117
+ // ============================================
118
+ /**
119
+ * Get platform capabilities by ID
120
+ */
121
+ function getPlatform(id) {
122
+ return exports.PLATFORM_PRESETS[id] ?? exports.CUSTOM_PLATFORM;
123
+ }
124
+ /**
125
+ * Create custom platform configuration
126
+ */
127
+ function createPlatform(base) {
128
+ const preset = exports.PLATFORM_PRESETS[base.id] ?? exports.CUSTOM_PLATFORM;
129
+ return { ...preset, ...base };
130
+ }
131
+ /**
132
+ * Check if platform can use CDN resources
133
+ */
134
+ function canUseCdn(platform) {
135
+ return platform.networkMode === 'full' && platform.scriptStrategy === 'cdn';
136
+ }
137
+ /**
138
+ * Check if platform needs inlined scripts
139
+ */
140
+ function needsInlineScripts(platform) {
141
+ return platform.scriptStrategy === 'inline' || platform.networkMode === 'blocked';
142
+ }
143
+ /**
144
+ * Check if platform supports full interactivity
145
+ */
146
+ function supportsFullInteractivity(platform) {
147
+ return platform.supportsWidgets && platform.supportsHtmx && platform.networkMode === 'full';
148
+ }
149
+ /**
150
+ * Get fallback rendering mode for unsupported platforms
151
+ */
152
+ function getFallbackMode(platform) {
153
+ if (platform.supportsWidgets && platform.supportsTailwind) {
154
+ return 'html';
155
+ }
156
+ if (platform.options?.['fallback'] === 'markdown') {
157
+ return 'markdown';
158
+ }
159
+ return 'text';
160
+ }
161
+ //# sourceMappingURL=platforms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platforms.js","sourceRoot":"","sources":["../../../src/theme/platforms.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AA4KH,kCAEC;AAKD,wCAKC;AAKD,8BAEC;AAKD,gDAEC;AAKD,8DAEC;AAKD,0CAQC;AAzJD,+CAA+C;AAC/C,mBAAmB;AACnB,+CAA+C;AAE/C;;;GAGG;AACU,QAAA,eAAe,GAAyB;IACnD,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,MAAM;IACnB,cAAc,EAAE,KAAK;IACrB,OAAO,EAAE;QACP,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,KAAK;KACf;CACF,CAAC;AAEF;;;GAGG;AACU,QAAA,eAAe,GAAyB;IACnD,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,oBAAoB;IAC1B,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,YAAY,EAAE,KAAK,EAAE,iDAAiD;IACtE,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,QAAQ;IACxB,aAAa,EAAE,GAAG,GAAG,IAAI,EAAE,4BAA4B;IACvD,eAAe,EAAE,CAAC,4BAA4B,EAAE,oBAAoB,CAAC;IACrE,OAAO,EAAE;QACP,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,OAAO,EAAE,gCAAgC;KACrD;CACF,CAAC;AAEF;;;GAGG;AACU,QAAA,eAAe,GAAyB;IACnD,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,KAAK;IACtB,gBAAgB,EAAE,KAAK;IACvB,YAAY,EAAE,KAAK;IACnB,WAAW,EAAE,SAAS;IACtB,cAAc,EAAE,QAAQ;IACxB,OAAO,EAAE;QACP,QAAQ,EAAE,UAAU,EAAE,kCAAkC;KACzD;CACF,CAAC;AAEF;;;GAGG;AACU,QAAA,cAAc,GAAyB;IAClD,EAAE,EAAE,OAAO;IACX,IAAI,EAAE,cAAc;IACpB,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,MAAM;IACnB,cAAc,EAAE,KAAK;IACrB,OAAO,EAAE;QACP,cAAc,EAAE,IAAI;KACrB;CACF,CAAC;AAEF;;GAEG;AACU,QAAA,eAAe,GAAyB;IACnD,EAAE,EAAE,QAAQ;IACZ,IAAI,EAAE,mBAAmB;IACzB,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,MAAM;IACnB,cAAc,EAAE,KAAK;CACtB,CAAC;AAEF;;GAEG;AACU,QAAA,gBAAgB,GAA6C;IACxE,MAAM,EAAE,uBAAe;IACvB,MAAM,EAAE,uBAAe;IACvB,MAAM,EAAE,uBAAe;IACvB,KAAK,EAAE,sBAAc;IACrB,MAAM,EAAE,uBAAe;CACxB,CAAC;AAEF,+CAA+C;AAC/C,iCAAiC;AACjC,+CAA+C;AAE/C;;GAEG;AACH,SAAgB,WAAW,CAAC,EAAc;IACxC,OAAO,wBAAgB,CAAC,EAAE,CAAC,IAAI,uBAAe,CAAC;AACjD,CAAC;AAED;;GAEG;AACH,SAAgB,cAAc,CAC5B,IAAsE;IAEtE,MAAM,MAAM,GAAG,wBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,uBAAe,CAAC;IAC5D,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CAAC,QAA8B;IACtD,OAAO,QAAQ,CAAC,WAAW,KAAK,MAAM,IAAI,QAAQ,CAAC,cAAc,KAAK,KAAK,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,QAA8B;IAC/D,OAAO,QAAQ,CAAC,cAAc,KAAK,QAAQ,IAAI,QAAQ,CAAC,WAAW,KAAK,SAAS,CAAC;AACpF,CAAC;AAED;;GAEG;AACH,SAAgB,yBAAyB,CAAC,QAA8B;IACtE,OAAO,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC,YAAY,IAAI,QAAQ,CAAC,WAAW,KAAK,MAAM,CAAC;AAC9F,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,QAA8B;IAC5D,IAAI,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC,gBAAgB,EAAE,CAAC;QAC1D,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,KAAK,UAAU,EAAE,CAAC;QAClD,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * LLM Platform Configurations\n *\n * Different LLM platforms have different capabilities for rendering UI:\n * - OpenAI: Full support (Canvas/Apps SDK) - Tailwind + HTMX with network\n * - Claude: Artifacts mode - Tailwind but NO network (scripts must be inlined)\n * - Gemini: No interactive widget support\n * - Custom MCP: Configurable based on client capabilities\n *\n * This module provides platform presets and utilities for building\n * compatible UI across different environments.\n */\n\n// ============================================\n// Platform Types\n// ============================================\n\n/**\n * Known LLM platform identifiers\n */\nexport type PlatformId = 'openai' | 'claude' | 'gemini' | 'ngrok' | 'custom';\n\n/**\n * Network access mode for the platform\n */\nexport type NetworkMode =\n | 'full' // Full network access (CDN, API calls)\n | 'blocked' // No network access (must inline everything)\n | 'limited'; // Limited network (specific domains only)\n\n/**\n * Script loading strategy\n */\nexport type ScriptStrategy =\n | 'cdn' // Load from CDN URLs\n | 'inline' // Inline script content directly\n | 'cached'; // Load once and cache for reuse\n\n/**\n * Platform capabilities configuration\n */\nexport interface PlatformCapabilities {\n /** Platform identifier */\n id: PlatformId;\n\n /** Human-readable name */\n name: string;\n\n /** Whether platform supports interactive widgets */\n supportsWidgets: boolean;\n\n /** Whether platform supports Tailwind CSS */\n supportsTailwind: boolean;\n\n /** Whether platform supports HTMX/dynamic content */\n supportsHtmx: boolean;\n\n /** Network access mode */\n networkMode: NetworkMode;\n\n /** How to load scripts */\n scriptStrategy: ScriptStrategy;\n\n /** Allowed domains for network requests (if limited) */\n allowedDomains?: string[];\n\n /** Content Security Policy restrictions */\n cspRestrictions?: string[];\n\n /** Maximum inline script size (bytes) */\n maxInlineSize?: number;\n\n /** Additional platform-specific options */\n options?: Record<string, unknown>;\n}\n\n// ============================================\n// Platform Presets\n// ============================================\n\n/**\n * OpenAI Platform Configuration\n * Full support via Canvas/Apps SDK\n */\nexport const OPENAI_PLATFORM: PlatformCapabilities = {\n id: 'openai',\n name: 'OpenAI',\n supportsWidgets: true,\n supportsTailwind: true,\n supportsHtmx: true,\n networkMode: 'full',\n scriptStrategy: 'cdn',\n options: {\n sdk: 'apps-sdk',\n version: '1.0',\n },\n};\n\n/**\n * Claude Platform Configuration\n * Artifacts mode - no network access, must inline scripts\n */\nexport const CLAUDE_PLATFORM: PlatformCapabilities = {\n id: 'claude',\n name: 'Claude (Artifacts)',\n supportsWidgets: true,\n supportsTailwind: true,\n supportsHtmx: false, // Network blocked, HTMX won't work for API calls\n networkMode: 'blocked',\n scriptStrategy: 'inline',\n maxInlineSize: 100 * 1024, // 100KB limit for artifacts\n cspRestrictions: [\"script-src 'unsafe-inline'\", \"connect-src 'none'\"],\n options: {\n mode: 'artifacts',\n framework: 'react', // Claude artifacts prefer React\n },\n};\n\n/**\n * Gemini Platform Configuration\n * No interactive widget support\n */\nexport const GEMINI_PLATFORM: PlatformCapabilities = {\n id: 'gemini',\n name: 'Gemini',\n supportsWidgets: false,\n supportsTailwind: false,\n supportsHtmx: false,\n networkMode: 'blocked',\n scriptStrategy: 'inline',\n options: {\n fallback: 'markdown', // Fall back to markdown rendering\n },\n};\n\n/**\n * Ngrok Platform Configuration\n * Bridge/tunnel - essential for HTMX\n */\nexport const NGROK_PLATFORM: PlatformCapabilities = {\n id: 'ngrok',\n name: 'Ngrok Tunnel',\n supportsWidgets: true,\n supportsTailwind: true,\n supportsHtmx: true,\n networkMode: 'full',\n scriptStrategy: 'cdn',\n options: {\n tunnelRequired: true,\n },\n};\n\n/**\n * Default custom MCP client configuration\n */\nexport const CUSTOM_PLATFORM: PlatformCapabilities = {\n id: 'custom',\n name: 'Custom MCP Client',\n supportsWidgets: true,\n supportsTailwind: true,\n supportsHtmx: true,\n networkMode: 'full',\n scriptStrategy: 'cdn',\n};\n\n/**\n * All platform presets\n */\nexport const PLATFORM_PRESETS: Record<PlatformId, PlatformCapabilities> = {\n openai: OPENAI_PLATFORM,\n claude: CLAUDE_PLATFORM,\n gemini: GEMINI_PLATFORM,\n ngrok: NGROK_PLATFORM,\n custom: CUSTOM_PLATFORM,\n};\n\n// ============================================\n// Platform Detection & Utilities\n// ============================================\n\n/**\n * Get platform capabilities by ID\n */\nexport function getPlatform(id: PlatformId): PlatformCapabilities {\n return PLATFORM_PRESETS[id] ?? CUSTOM_PLATFORM;\n}\n\n/**\n * Create custom platform configuration\n */\nexport function createPlatform(\n base: Partial<PlatformCapabilities> & { id: PlatformId; name: string },\n): PlatformCapabilities {\n const preset = PLATFORM_PRESETS[base.id] ?? CUSTOM_PLATFORM;\n return { ...preset, ...base };\n}\n\n/**\n * Check if platform can use CDN resources\n */\nexport function canUseCdn(platform: PlatformCapabilities): boolean {\n return platform.networkMode === 'full' && platform.scriptStrategy === 'cdn';\n}\n\n/**\n * Check if platform needs inlined scripts\n */\nexport function needsInlineScripts(platform: PlatformCapabilities): boolean {\n return platform.scriptStrategy === 'inline' || platform.networkMode === 'blocked';\n}\n\n/**\n * Check if platform supports full interactivity\n */\nexport function supportsFullInteractivity(platform: PlatformCapabilities): boolean {\n return platform.supportsWidgets && platform.supportsHtmx && platform.networkMode === 'full';\n}\n\n/**\n * Get fallback rendering mode for unsupported platforms\n */\nexport function getFallbackMode(platform: PlatformCapabilities): 'html' | 'markdown' | 'text' {\n if (platform.supportsWidgets && platform.supportsTailwind) {\n return 'html';\n }\n if (platform.options?.['fallback'] === 'markdown') {\n return 'markdown';\n }\n return 'text';\n}\n"]}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * @file github-openai.ts
3
+ * @description Default theme with GitHub/OpenAI gray-black aesthetic.
4
+ *
5
+ * This is the new default theme for @frontmcp/ui, featuring a monochromatic
6
+ * gray-black color palette inspired by GitHub and OpenAI's design systems.
7
+ * Includes system UI font stack, smaller border radii, and subtle shadows.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * import { GITHUB_OPENAI_THEME, createTheme } from '@frontmcp/ui';
12
+ *
13
+ * // Use directly
14
+ * baseLayout(content, { theme: GITHUB_OPENAI_THEME });
15
+ *
16
+ * // Or extend
17
+ * const myTheme = createTheme({
18
+ * colors: { semantic: { primary: '#0969da' } },
19
+ * });
20
+ * ```
21
+ *
22
+ * @module @frontmcp/ui/theme/presets/github-openai
23
+ */
24
+ import type { ThemeConfig } from '../theme';
25
+ /**
26
+ * GitHub/OpenAI inspired default theme
27
+ *
28
+ * Color palette:
29
+ * - Primary: #24292f (near-black for primary actions)
30
+ * - Secondary: #57606a (medium gray for secondary)
31
+ * - Accent: #0969da (blue accent for links/highlights)
32
+ * - Success: #1a7f37 (GitHub green)
33
+ * - Warning: #9a6700 (amber warning)
34
+ * - Danger: #cf222e (GitHub red)
35
+ *
36
+ * Typography:
37
+ * - System UI font stack (Apple/GitHub style)
38
+ * - Monospace: ui-monospace, SFMono-Regular
39
+ *
40
+ * Design tokens:
41
+ * - Smaller border radii (6px default)
42
+ * - Subtle shadows with gray tones
43
+ * - Light gray borders (#d0d7de)
44
+ */
45
+ export declare const GITHUB_OPENAI_THEME: ThemeConfig;
46
+ /**
47
+ * Export as DEFAULT_THEME for backwards compatibility
48
+ */
49
+ export declare const DEFAULT_THEME: ThemeConfig;
@@ -0,0 +1,189 @@
1
+ "use strict";
2
+ /**
3
+ * @file github-openai.ts
4
+ * @description Default theme with GitHub/OpenAI gray-black aesthetic.
5
+ *
6
+ * This is the new default theme for @frontmcp/ui, featuring a monochromatic
7
+ * gray-black color palette inspired by GitHub and OpenAI's design systems.
8
+ * Includes system UI font stack, smaller border radii, and subtle shadows.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { GITHUB_OPENAI_THEME, createTheme } from '@frontmcp/ui';
13
+ *
14
+ * // Use directly
15
+ * baseLayout(content, { theme: GITHUB_OPENAI_THEME });
16
+ *
17
+ * // Or extend
18
+ * const myTheme = createTheme({
19
+ * colors: { semantic: { primary: '#0969da' } },
20
+ * });
21
+ * ```
22
+ *
23
+ * @module @frontmcp/ui/theme/presets/github-openai
24
+ */
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.DEFAULT_THEME = exports.GITHUB_OPENAI_THEME = void 0;
27
+ /**
28
+ * GitHub/OpenAI inspired default theme
29
+ *
30
+ * Color palette:
31
+ * - Primary: #24292f (near-black for primary actions)
32
+ * - Secondary: #57606a (medium gray for secondary)
33
+ * - Accent: #0969da (blue accent for links/highlights)
34
+ * - Success: #1a7f37 (GitHub green)
35
+ * - Warning: #9a6700 (amber warning)
36
+ * - Danger: #cf222e (GitHub red)
37
+ *
38
+ * Typography:
39
+ * - System UI font stack (Apple/GitHub style)
40
+ * - Monospace: ui-monospace, SFMono-Regular
41
+ *
42
+ * Design tokens:
43
+ * - Smaller border radii (6px default)
44
+ * - Subtle shadows with gray tones
45
+ * - Light gray borders (#d0d7de)
46
+ */
47
+ exports.GITHUB_OPENAI_THEME = {
48
+ name: 'github-openai',
49
+ colors: {
50
+ semantic: {
51
+ // Primary: Near-black for main actions and branding
52
+ primary: '#24292f',
53
+ // Secondary: Medium gray for secondary elements
54
+ secondary: '#57606a',
55
+ // Accent: Blue for links, focus states, and highlights
56
+ accent: '#0969da',
57
+ // Status colors
58
+ success: '#1a7f37', // GitHub green
59
+ warning: '#9a6700', // Amber warning
60
+ danger: '#cf222e', // GitHub red
61
+ info: '#0969da', // Blue info
62
+ },
63
+ surface: {
64
+ // Pure white background
65
+ background: '#ffffff',
66
+ // Light gray surface (GitHub code background style)
67
+ surface: '#f6f8fa',
68
+ // White elevated surfaces (modals, cards)
69
+ elevated: '#ffffff',
70
+ // Dark semi-transparent overlay
71
+ overlay: 'rgba(27, 31, 36, 0.5)',
72
+ },
73
+ text: {
74
+ // Near-black for primary text
75
+ primary: '#24292f',
76
+ // Gray for secondary/muted text
77
+ secondary: '#57606a',
78
+ // Light gray for disabled text
79
+ disabled: '#8c959f',
80
+ // White for text on dark backgrounds
81
+ inverse: '#ffffff',
82
+ // Blue for links
83
+ link: '#0969da',
84
+ },
85
+ border: {
86
+ // Light gray border (GitHub style)
87
+ default: '#d0d7de',
88
+ // Medium gray on hover
89
+ hover: '#8c959f',
90
+ // Blue focus ring
91
+ focus: '#0969da',
92
+ // Subtle divider
93
+ divider: '#d8dee4',
94
+ },
95
+ },
96
+ typography: {
97
+ families: {
98
+ // System UI font stack (GitHub/Apple style)
99
+ sans: '-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"',
100
+ // Monospace stack
101
+ mono: 'ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, "Liberation Mono", monospace',
102
+ },
103
+ sizes: {
104
+ xs: '0.75rem', // 12px
105
+ sm: '0.875rem', // 14px
106
+ base: '1rem', // 16px
107
+ lg: '1.125rem', // 18px
108
+ xl: '1.25rem', // 20px
109
+ '2xl': '1.5rem', // 24px
110
+ '3xl': '1.875rem', // 30px
111
+ '4xl': '2.25rem', // 36px
112
+ },
113
+ weights: {
114
+ normal: '400',
115
+ medium: '500',
116
+ semibold: '600',
117
+ bold: '700',
118
+ },
119
+ },
120
+ radius: {
121
+ none: '0',
122
+ sm: '3px', // GitHub uses smaller radii
123
+ md: '6px',
124
+ lg: '8px',
125
+ xl: '12px',
126
+ '2xl': '16px',
127
+ full: '9999px',
128
+ },
129
+ shadows: {
130
+ // Subtle shadows with gray tones
131
+ sm: '0 1px 0 rgba(27, 31, 36, 0.04)',
132
+ md: '0 3px 6px rgba(140, 149, 159, 0.15)',
133
+ lg: '0 8px 24px rgba(140, 149, 159, 0.2)',
134
+ xl: '0 12px 28px rgba(140, 149, 159, 0.3)',
135
+ },
136
+ components: {
137
+ button: {
138
+ radius: '6px',
139
+ paddingX: '16px',
140
+ paddingY: '5px',
141
+ fontSize: '14px',
142
+ fontWeight: '500',
143
+ },
144
+ card: {
145
+ radius: '6px',
146
+ padding: '16px',
147
+ shadow: '0 1px 0 rgba(27, 31, 36, 0.04)',
148
+ borderWidth: '1px',
149
+ },
150
+ input: {
151
+ radius: '6px',
152
+ paddingX: '12px',
153
+ paddingY: '5px',
154
+ borderWidth: '1px',
155
+ focusRingWidth: '3px',
156
+ },
157
+ },
158
+ cdn: {
159
+ fonts: {
160
+ preconnect: ['https://fonts.googleapis.com', 'https://fonts.gstatic.com'],
161
+ stylesheets: [
162
+ // System UI fonts don't need external stylesheets, but we include
163
+ // Inter as an optional enhancement for consistent cross-platform rendering
164
+ 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap',
165
+ ],
166
+ },
167
+ icons: {
168
+ script: {
169
+ url: 'https://cdn.jsdelivr.net/npm/lucide@0.294.0/dist/umd/lucide.min.js',
170
+ },
171
+ },
172
+ scripts: {
173
+ tailwind: 'https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4',
174
+ htmx: {
175
+ url: 'https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.7/htmx.min.js',
176
+ integrity: 'sha512-T6VLg/MJYMbLTmQ8VLvonbWg8VOvmDhXcOvHzCwo6ShdGuUU5SEcp1IAPXL4k9lVoMi8gRXl5K/S/zh43Y9rJA==',
177
+ },
178
+ alpine: {
179
+ url: 'https://cdn.jsdelivr.net/npm/alpinejs@3.14.3/dist/cdn.min.js',
180
+ integrity: 'sha384-6zY8MFQJ/EqS1r4RJl+7j8rvZPuBWpT0RzWf+IFcKhxqUzQNmJzA1X1VEVZhYaEz',
181
+ },
182
+ },
183
+ },
184
+ };
185
+ /**
186
+ * Export as DEFAULT_THEME for backwards compatibility
187
+ */
188
+ exports.DEFAULT_THEME = exports.GITHUB_OPENAI_THEME;
189
+ //# sourceMappingURL=github-openai.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-openai.js","sourceRoot":"","sources":["../../../../src/theme/presets/github-openai.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * @file github-openai.ts\n * @description Default theme with GitHub/OpenAI gray-black aesthetic.\n *\n * This is the new default theme for @frontmcp/ui, featuring a monochromatic\n * gray-black color palette inspired by GitHub and OpenAI's design systems.\n * Includes system UI font stack, smaller border radii, and subtle shadows.\n *\n * @example\n * ```typescript\n * import { GITHUB_OPENAI_THEME, createTheme } from '@frontmcp/ui';\n *\n * // Use directly\n * baseLayout(content, { theme: GITHUB_OPENAI_THEME });\n *\n * // Or extend\n * const myTheme = createTheme({\n * colors: { semantic: { primary: '#0969da' } },\n * });\n * ```\n *\n * @module @frontmcp/ui/theme/presets/github-openai\n */\n\nimport type { ThemeConfig } from '../theme';\n\n/**\n * GitHub/OpenAI inspired default theme\n *\n * Color palette:\n * - Primary: #24292f (near-black for primary actions)\n * - Secondary: #57606a (medium gray for secondary)\n * - Accent: #0969da (blue accent for links/highlights)\n * - Success: #1a7f37 (GitHub green)\n * - Warning: #9a6700 (amber warning)\n * - Danger: #cf222e (GitHub red)\n *\n * Typography:\n * - System UI font stack (Apple/GitHub style)\n * - Monospace: ui-monospace, SFMono-Regular\n *\n * Design tokens:\n * - Smaller border radii (6px default)\n * - Subtle shadows with gray tones\n * - Light gray borders (#d0d7de)\n */\nexport const GITHUB_OPENAI_THEME: ThemeConfig = {\n name: 'github-openai',\n\n colors: {\n semantic: {\n // Primary: Near-black for main actions and branding\n primary: '#24292f',\n // Secondary: Medium gray for secondary elements\n secondary: '#57606a',\n // Accent: Blue for links, focus states, and highlights\n accent: '#0969da',\n // Status colors\n success: '#1a7f37', // GitHub green\n warning: '#9a6700', // Amber warning\n danger: '#cf222e', // GitHub red\n info: '#0969da', // Blue info\n },\n surface: {\n // Pure white background\n background: '#ffffff',\n // Light gray surface (GitHub code background style)\n surface: '#f6f8fa',\n // White elevated surfaces (modals, cards)\n elevated: '#ffffff',\n // Dark semi-transparent overlay\n overlay: 'rgba(27, 31, 36, 0.5)',\n },\n text: {\n // Near-black for primary text\n primary: '#24292f',\n // Gray for secondary/muted text\n secondary: '#57606a',\n // Light gray for disabled text\n disabled: '#8c959f',\n // White for text on dark backgrounds\n inverse: '#ffffff',\n // Blue for links\n link: '#0969da',\n },\n border: {\n // Light gray border (GitHub style)\n default: '#d0d7de',\n // Medium gray on hover\n hover: '#8c959f',\n // Blue focus ring\n focus: '#0969da',\n // Subtle divider\n divider: '#d8dee4',\n },\n },\n\n typography: {\n families: {\n // System UI font stack (GitHub/Apple style)\n sans: '-apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Noto Sans\", Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\"',\n // Monospace stack\n mono: 'ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, \"Liberation Mono\", monospace',\n },\n sizes: {\n xs: '0.75rem', // 12px\n sm: '0.875rem', // 14px\n base: '1rem', // 16px\n lg: '1.125rem', // 18px\n xl: '1.25rem', // 20px\n '2xl': '1.5rem', // 24px\n '3xl': '1.875rem', // 30px\n '4xl': '2.25rem', // 36px\n },\n weights: {\n normal: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n },\n },\n\n radius: {\n none: '0',\n sm: '3px', // GitHub uses smaller radii\n md: '6px',\n lg: '8px',\n xl: '12px',\n '2xl': '16px',\n full: '9999px',\n },\n\n shadows: {\n // Subtle shadows with gray tones\n sm: '0 1px 0 rgba(27, 31, 36, 0.04)',\n md: '0 3px 6px rgba(140, 149, 159, 0.15)',\n lg: '0 8px 24px rgba(140, 149, 159, 0.2)',\n xl: '0 12px 28px rgba(140, 149, 159, 0.3)',\n },\n\n components: {\n button: {\n radius: '6px',\n paddingX: '16px',\n paddingY: '5px',\n fontSize: '14px',\n fontWeight: '500',\n },\n card: {\n radius: '6px',\n padding: '16px',\n shadow: '0 1px 0 rgba(27, 31, 36, 0.04)',\n borderWidth: '1px',\n },\n input: {\n radius: '6px',\n paddingX: '12px',\n paddingY: '5px',\n borderWidth: '1px',\n focusRingWidth: '3px',\n },\n },\n\n cdn: {\n fonts: {\n preconnect: ['https://fonts.googleapis.com', 'https://fonts.gstatic.com'],\n stylesheets: [\n // System UI fonts don't need external stylesheets, but we include\n // Inter as an optional enhancement for consistent cross-platform rendering\n 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap',\n ],\n },\n icons: {\n script: {\n url: 'https://cdn.jsdelivr.net/npm/lucide@0.294.0/dist/umd/lucide.min.js',\n },\n },\n scripts: {\n tailwind: 'https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4',\n htmx: {\n url: 'https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.7/htmx.min.js',\n integrity: 'sha512-T6VLg/MJYMbLTmQ8VLvonbWg8VOvmDhXcOvHzCwo6ShdGuUU5SEcp1IAPXL4k9lVoMi8gRXl5K/S/zh43Y9rJA==',\n },\n alpine: {\n url: 'https://cdn.jsdelivr.net/npm/alpinejs@3.14.3/dist/cdn.min.js',\n integrity: 'sha384-6zY8MFQJ/EqS1r4RJl+7j8rvZPuBWpT0RzWf+IFcKhxqUzQNmJzA1X1VEVZhYaEz',\n },\n },\n },\n};\n\n/**\n * Export as DEFAULT_THEME for backwards compatibility\n */\nexport const DEFAULT_THEME = GITHUB_OPENAI_THEME;\n"]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @file index.ts
3
+ * @description Theme presets module exports.
4
+ *
5
+ * Provides pre-configured theme presets for different design aesthetics.
6
+ * The GitHub/OpenAI theme is the default for all @frontmcp/ui components.
7
+ *
8
+ * @module @frontmcp/ui/theme/presets
9
+ */
10
+ export { GITHUB_OPENAI_THEME, DEFAULT_THEME } from './github-openai';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /**
3
+ * @file index.ts
4
+ * @description Theme presets module exports.
5
+ *
6
+ * Provides pre-configured theme presets for different design aesthetics.
7
+ * The GitHub/OpenAI theme is the default for all @frontmcp/ui components.
8
+ *
9
+ * @module @frontmcp/ui/theme/presets
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DEFAULT_THEME = exports.GITHUB_OPENAI_THEME = void 0;
13
+ // GitHub/OpenAI theme (default)
14
+ var github_openai_1 = require("./github-openai");
15
+ Object.defineProperty(exports, "GITHUB_OPENAI_THEME", { enumerable: true, get: function () { return github_openai_1.GITHUB_OPENAI_THEME; } });
16
+ Object.defineProperty(exports, "DEFAULT_THEME", { enumerable: true, get: function () { return github_openai_1.DEFAULT_THEME; } });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/theme/presets/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,gCAAgC;AAChC,iDAAqE;AAA5D,oHAAA,mBAAmB,OAAA;AAAE,8GAAA,aAAa,OAAA","sourcesContent":["/**\n * @file index.ts\n * @description Theme presets module exports.\n *\n * Provides pre-configured theme presets for different design aesthetics.\n * The GitHub/OpenAI theme is the default for all @frontmcp/ui components.\n *\n * @module @frontmcp/ui/theme/presets\n */\n\n// GitHub/OpenAI theme (default)\nexport { GITHUB_OPENAI_THEME, DEFAULT_THEME } from './github-openai';\n"]}