@frontmcp/uipack 0.12.2 → 1.0.0-beta.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 (298) hide show
  1. package/CLAUDE.md +56 -154
  2. package/README.md +367 -62
  3. package/adapters/base-template.d.ts +30 -0
  4. package/adapters/base-template.d.ts.map +1 -0
  5. package/adapters/cdn-info.d.ts +34 -0
  6. package/adapters/cdn-info.d.ts.map +1 -0
  7. package/adapters/constants.d.ts +18 -0
  8. package/adapters/constants.d.ts.map +1 -0
  9. package/adapters/content-detector.d.ts +19 -0
  10. package/adapters/content-detector.d.ts.map +1 -0
  11. package/adapters/content-renderers.d.ts +27 -0
  12. package/adapters/content-renderers.d.ts.map +1 -0
  13. package/adapters/index.d.ts +14 -7
  14. package/adapters/index.d.ts.map +1 -1
  15. package/adapters/index.js +2343 -426
  16. package/adapters/render-failure.d.ts +18 -0
  17. package/adapters/render-failure.d.ts.map +1 -0
  18. package/adapters/response-builder.d.ts +34 -104
  19. package/adapters/response-builder.d.ts.map +1 -1
  20. package/adapters/serving-mode.d.ts +28 -91
  21. package/adapters/serving-mode.d.ts.map +1 -1
  22. package/adapters/template-renderer.d.ts +50 -0
  23. package/adapters/template-renderer.d.ts.map +1 -0
  24. package/adapters/type-detector.d.ts +18 -0
  25. package/adapters/type-detector.d.ts.map +1 -0
  26. package/bridge-runtime/index.js +1 -1
  27. package/component/index.d.ts +14 -0
  28. package/component/index.d.ts.map +1 -0
  29. package/component/index.js +2043 -0
  30. package/component/loader.d.ts +36 -0
  31. package/component/loader.d.ts.map +1 -0
  32. package/component/renderer.d.ts +30 -0
  33. package/component/renderer.d.ts.map +1 -0
  34. package/component/transpiler.d.ts +49 -0
  35. package/component/transpiler.d.ts.map +1 -0
  36. package/component/types.d.ts +82 -0
  37. package/component/types.d.ts.map +1 -0
  38. package/esm/adapters/index.mjs +2337 -422
  39. package/esm/bridge-runtime/index.mjs +1 -1
  40. package/esm/component/index.mjs +2013 -0
  41. package/esm/index.mjs +3446 -13935
  42. package/esm/package.json +3 -12
  43. package/esm/resolver/index.mjs +661 -0
  44. package/esm/shell/index.mjs +1406 -0
  45. package/esm/types/index.mjs +11 -11
  46. package/esm/utils/index.mjs +53 -8
  47. package/index.d.ts +12 -40
  48. package/index.d.ts.map +1 -1
  49. package/index.js +3579 -14218
  50. package/package.json +3 -12
  51. package/resolver/cdn-registry.d.ts +39 -0
  52. package/resolver/cdn-registry.d.ts.map +1 -0
  53. package/resolver/esm-sh.resolver.d.ts +54 -0
  54. package/resolver/esm-sh.resolver.d.ts.map +1 -0
  55. package/resolver/import-map.d.ts +47 -0
  56. package/resolver/import-map.d.ts.map +1 -0
  57. package/resolver/import-parser.d.ts +28 -0
  58. package/resolver/import-parser.d.ts.map +1 -0
  59. package/resolver/import-rewriter.d.ts +29 -0
  60. package/resolver/import-rewriter.d.ts.map +1 -0
  61. package/resolver/index.d.ts +15 -0
  62. package/resolver/index.d.ts.map +1 -0
  63. package/resolver/index.js +708 -0
  64. package/resolver/types.d.ts +191 -0
  65. package/resolver/types.d.ts.map +1 -0
  66. package/shell/builder.d.ts +31 -0
  67. package/shell/builder.d.ts.map +1 -0
  68. package/shell/csp.d.ts +37 -0
  69. package/shell/csp.d.ts.map +1 -0
  70. package/shell/custom-shell-applier.d.ts +33 -0
  71. package/shell/custom-shell-applier.d.ts.map +1 -0
  72. package/shell/custom-shell-resolver.d.ts +47 -0
  73. package/shell/custom-shell-resolver.d.ts.map +1 -0
  74. package/shell/custom-shell-types.d.ts +75 -0
  75. package/shell/custom-shell-types.d.ts.map +1 -0
  76. package/shell/custom-shell-validator.d.ts +26 -0
  77. package/shell/custom-shell-validator.d.ts.map +1 -0
  78. package/shell/data-injector.d.ts +40 -0
  79. package/shell/data-injector.d.ts.map +1 -0
  80. package/shell/index.d.ts +19 -0
  81. package/shell/index.d.ts.map +1 -0
  82. package/shell/index.js +1453 -0
  83. package/shell/types.d.ts +54 -0
  84. package/shell/types.d.ts.map +1 -0
  85. package/types/index.d.ts +1 -3
  86. package/types/index.d.ts.map +1 -1
  87. package/types/index.js +11 -11
  88. package/types/ui-config.d.ts +50 -11
  89. package/types/ui-config.d.ts.map +1 -1
  90. package/types/ui-runtime.d.ts +8 -82
  91. package/types/ui-runtime.d.ts.map +1 -1
  92. package/utils/index.d.ts +9 -3
  93. package/utils/index.d.ts.map +1 -1
  94. package/utils/index.js +59 -7
  95. package/adapters/platform-meta.constants.d.ts +0 -26
  96. package/adapters/platform-meta.constants.d.ts.map +0 -1
  97. package/adapters/platform-meta.d.ts +0 -234
  98. package/adapters/platform-meta.d.ts.map +0 -1
  99. package/base-template/bridge.d.ts +0 -90
  100. package/base-template/bridge.d.ts.map +0 -1
  101. package/base-template/default-base-template.d.ts +0 -91
  102. package/base-template/default-base-template.d.ts.map +0 -1
  103. package/base-template/index.d.ts +0 -15
  104. package/base-template/index.d.ts.map +0 -1
  105. package/base-template/index.js +0 -1393
  106. package/base-template/polyfills.d.ts +0 -31
  107. package/base-template/polyfills.d.ts.map +0 -1
  108. package/base-template/theme-styles.d.ts +0 -74
  109. package/base-template/theme-styles.d.ts.map +0 -1
  110. package/build/builders/base-builder.d.ts +0 -124
  111. package/build/builders/base-builder.d.ts.map +0 -1
  112. package/build/builders/esbuild-config.d.ts +0 -94
  113. package/build/builders/esbuild-config.d.ts.map +0 -1
  114. package/build/builders/hybrid-builder.d.ts +0 -93
  115. package/build/builders/hybrid-builder.d.ts.map +0 -1
  116. package/build/builders/index.d.ts +0 -17
  117. package/build/builders/index.d.ts.map +0 -1
  118. package/build/builders/inline-builder.d.ts +0 -83
  119. package/build/builders/inline-builder.d.ts.map +0 -1
  120. package/build/builders/static-builder.d.ts +0 -78
  121. package/build/builders/static-builder.d.ts.map +0 -1
  122. package/build/builders/types.d.ts +0 -341
  123. package/build/builders/types.d.ts.map +0 -1
  124. package/build/cdn-resources.d.ts +0 -244
  125. package/build/cdn-resources.d.ts.map +0 -1
  126. package/build/hybrid-data.d.ts +0 -127
  127. package/build/hybrid-data.d.ts.map +0 -1
  128. package/build/index.d.ts +0 -299
  129. package/build/index.d.ts.map +0 -1
  130. package/build/index.js +0 -8699
  131. package/build/ui-components-browser.d.ts +0 -64
  132. package/build/ui-components-browser.d.ts.map +0 -1
  133. package/build/widget-manifest.d.ts +0 -362
  134. package/build/widget-manifest.d.ts.map +0 -1
  135. package/bundler/cache.d.ts +0 -173
  136. package/bundler/cache.d.ts.map +0 -1
  137. package/bundler/file-cache/component-builder.d.ts +0 -167
  138. package/bundler/file-cache/component-builder.d.ts.map +0 -1
  139. package/bundler/file-cache/hash-calculator.d.ts +0 -155
  140. package/bundler/file-cache/hash-calculator.d.ts.map +0 -1
  141. package/bundler/file-cache/index.d.ts +0 -12
  142. package/bundler/file-cache/index.d.ts.map +0 -1
  143. package/bundler/file-cache/storage/filesystem.d.ts +0 -149
  144. package/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
  145. package/bundler/file-cache/storage/index.d.ts +0 -11
  146. package/bundler/file-cache/storage/index.d.ts.map +0 -1
  147. package/bundler/file-cache/storage/interface.d.ts +0 -152
  148. package/bundler/file-cache/storage/interface.d.ts.map +0 -1
  149. package/bundler/file-cache/storage/redis.d.ts +0 -139
  150. package/bundler/file-cache/storage/redis.d.ts.map +0 -1
  151. package/bundler/index.d.ts +0 -35
  152. package/bundler/index.d.ts.map +0 -1
  153. package/bundler/index.js +0 -2953
  154. package/bundler/sandbox/enclave-adapter.d.ts +0 -121
  155. package/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
  156. package/bundler/sandbox/executor.d.ts +0 -14
  157. package/bundler/sandbox/executor.d.ts.map +0 -1
  158. package/bundler/sandbox/policy.d.ts +0 -62
  159. package/bundler/sandbox/policy.d.ts.map +0 -1
  160. package/bundler/types.d.ts +0 -702
  161. package/bundler/types.d.ts.map +0 -1
  162. package/dependency/cdn-registry.d.ts +0 -98
  163. package/dependency/cdn-registry.d.ts.map +0 -1
  164. package/dependency/import-map.d.ts +0 -186
  165. package/dependency/import-map.d.ts.map +0 -1
  166. package/dependency/import-parser.d.ts +0 -82
  167. package/dependency/import-parser.d.ts.map +0 -1
  168. package/dependency/index.d.ts +0 -17
  169. package/dependency/index.d.ts.map +0 -1
  170. package/dependency/index.js +0 -3180
  171. package/dependency/resolver.d.ts +0 -164
  172. package/dependency/resolver.d.ts.map +0 -1
  173. package/dependency/schemas.d.ts +0 -486
  174. package/dependency/schemas.d.ts.map +0 -1
  175. package/dependency/template-loader.d.ts +0 -204
  176. package/dependency/template-loader.d.ts.map +0 -1
  177. package/dependency/template-processor.d.ts +0 -118
  178. package/dependency/template-processor.d.ts.map +0 -1
  179. package/dependency/types.d.ts +0 -739
  180. package/dependency/types.d.ts.map +0 -1
  181. package/esm/base-template/index.mjs +0 -1359
  182. package/esm/build/index.mjs +0 -8601
  183. package/esm/bundler/index.mjs +0 -2895
  184. package/esm/dependency/index.mjs +0 -3068
  185. package/esm/handlebars/index.mjs +0 -587
  186. package/esm/registry/index.mjs +0 -6305
  187. package/esm/renderers/index.mjs +0 -1557
  188. package/esm/runtime/index.mjs +0 -5361
  189. package/esm/styles/index.mjs +0 -171
  190. package/esm/theme/index.mjs +0 -756
  191. package/esm/tool-template/index.mjs +0 -3652
  192. package/esm/validation/index.mjs +0 -542
  193. package/handlebars/expression-extractor.d.ts +0 -147
  194. package/handlebars/expression-extractor.d.ts.map +0 -1
  195. package/handlebars/helpers.d.ts +0 -339
  196. package/handlebars/helpers.d.ts.map +0 -1
  197. package/handlebars/index.d.ts +0 -195
  198. package/handlebars/index.d.ts.map +0 -1
  199. package/handlebars/index.js +0 -659
  200. package/preview/claude-preview.d.ts +0 -67
  201. package/preview/claude-preview.d.ts.map +0 -1
  202. package/preview/generic-preview.d.ts +0 -66
  203. package/preview/generic-preview.d.ts.map +0 -1
  204. package/preview/index.d.ts +0 -36
  205. package/preview/index.d.ts.map +0 -1
  206. package/preview/openai-preview.d.ts +0 -70
  207. package/preview/openai-preview.d.ts.map +0 -1
  208. package/preview/types.d.ts +0 -199
  209. package/preview/types.d.ts.map +0 -1
  210. package/registry/index.d.ts +0 -46
  211. package/registry/index.d.ts.map +0 -1
  212. package/registry/index.js +0 -6342
  213. package/registry/render-template.d.ts +0 -91
  214. package/registry/render-template.d.ts.map +0 -1
  215. package/registry/tool-ui.registry.d.ts +0 -294
  216. package/registry/tool-ui.registry.d.ts.map +0 -1
  217. package/registry/uri-utils.d.ts +0 -56
  218. package/registry/uri-utils.d.ts.map +0 -1
  219. package/renderers/cache.d.ts +0 -145
  220. package/renderers/cache.d.ts.map +0 -1
  221. package/renderers/html.renderer.d.ts +0 -123
  222. package/renderers/html.renderer.d.ts.map +0 -1
  223. package/renderers/index.d.ts +0 -36
  224. package/renderers/index.d.ts.map +0 -1
  225. package/renderers/index.js +0 -1603
  226. package/renderers/mdx-client.renderer.d.ts +0 -124
  227. package/renderers/mdx-client.renderer.d.ts.map +0 -1
  228. package/renderers/registry.d.ts +0 -133
  229. package/renderers/registry.d.ts.map +0 -1
  230. package/renderers/types.d.ts +0 -343
  231. package/renderers/types.d.ts.map +0 -1
  232. package/renderers/utils/detect.d.ts +0 -107
  233. package/renderers/utils/detect.d.ts.map +0 -1
  234. package/renderers/utils/hash.d.ts +0 -40
  235. package/renderers/utils/hash.d.ts.map +0 -1
  236. package/renderers/utils/index.d.ts +0 -9
  237. package/renderers/utils/index.d.ts.map +0 -1
  238. package/renderers/utils/transpiler.d.ts +0 -70
  239. package/renderers/utils/transpiler.d.ts.map +0 -1
  240. package/runtime/adapters/html.adapter.d.ts +0 -59
  241. package/runtime/adapters/html.adapter.d.ts.map +0 -1
  242. package/runtime/adapters/index.d.ts +0 -26
  243. package/runtime/adapters/index.d.ts.map +0 -1
  244. package/runtime/adapters/mdx.adapter.d.ts +0 -73
  245. package/runtime/adapters/mdx.adapter.d.ts.map +0 -1
  246. package/runtime/adapters/types.d.ts +0 -95
  247. package/runtime/adapters/types.d.ts.map +0 -1
  248. package/runtime/csp.d.ts +0 -48
  249. package/runtime/csp.d.ts.map +0 -1
  250. package/runtime/index.d.ts +0 -17
  251. package/runtime/index.d.ts.map +0 -1
  252. package/runtime/index.js +0 -5432
  253. package/runtime/mcp-bridge.d.ts +0 -101
  254. package/runtime/mcp-bridge.d.ts.map +0 -1
  255. package/runtime/renderer-runtime.d.ts +0 -133
  256. package/runtime/renderer-runtime.d.ts.map +0 -1
  257. package/runtime/sanitizer.d.ts +0 -180
  258. package/runtime/sanitizer.d.ts.map +0 -1
  259. package/runtime/types.d.ts +0 -415
  260. package/runtime/types.d.ts.map +0 -1
  261. package/runtime/wrapper.d.ts +0 -421
  262. package/runtime/wrapper.d.ts.map +0 -1
  263. package/styles/index.d.ts +0 -8
  264. package/styles/index.d.ts.map +0 -1
  265. package/styles/index.js +0 -222
  266. package/styles/variants.d.ts +0 -51
  267. package/styles/variants.d.ts.map +0 -1
  268. package/theme/cdn.d.ts +0 -195
  269. package/theme/cdn.d.ts.map +0 -1
  270. package/theme/css-to-theme.d.ts +0 -64
  271. package/theme/css-to-theme.d.ts.map +0 -1
  272. package/theme/index.d.ts +0 -19
  273. package/theme/index.d.ts.map +0 -1
  274. package/theme/index.js +0 -814
  275. package/theme/platforms.d.ts +0 -102
  276. package/theme/platforms.d.ts.map +0 -1
  277. package/theme/presets/github-openai.d.ts +0 -50
  278. package/theme/presets/github-openai.d.ts.map +0 -1
  279. package/theme/presets/index.d.ts +0 -11
  280. package/theme/presets/index.d.ts.map +0 -1
  281. package/theme/theme.d.ts +0 -396
  282. package/theme/theme.d.ts.map +0 -1
  283. package/tool-template/builder.d.ts +0 -213
  284. package/tool-template/builder.d.ts.map +0 -1
  285. package/tool-template/index.d.ts +0 -16
  286. package/tool-template/index.d.ts.map +0 -1
  287. package/tool-template/index.js +0 -3690
  288. package/validation/error-box.d.ts +0 -56
  289. package/validation/error-box.d.ts.map +0 -1
  290. package/validation/index.d.ts +0 -13
  291. package/validation/index.d.ts.map +0 -1
  292. package/validation/index.js +0 -576
  293. package/validation/schema-paths.d.ts +0 -118
  294. package/validation/schema-paths.d.ts.map +0 -1
  295. package/validation/template-validator.d.ts +0 -143
  296. package/validation/template-validator.d.ts.map +0 -1
  297. package/validation/wrapper.d.ts +0 -97
  298. package/validation/wrapper.d.ts.map +0 -1
@@ -1,51 +0,0 @@
1
- /**
2
- * @file variants.ts
3
- * @description Centralized CSS class definitions for all UI components.
4
- *
5
- * This is the single source of truth for Tailwind CSS classes used across
6
- * all components (Card, Badge, Button, Alert, etc.).
7
- *
8
- * @module @frontmcp/ui/styles
9
- */
10
- export type CardVariant = 'default' | 'outlined' | 'elevated' | 'filled' | 'ghost';
11
- export type CardSize = 'sm' | 'md' | 'lg';
12
- export declare const CARD_VARIANTS: Record<CardVariant, string>;
13
- export declare const CARD_SIZES: Record<CardSize, string>;
14
- export declare function getCardVariantClasses(variant: CardVariant): string;
15
- export declare function getCardSizeClasses(size: CardSize): string;
16
- export type BadgeVariant = 'default' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'outline';
17
- export type BadgeSize = 'sm' | 'md' | 'lg';
18
- export declare const BADGE_VARIANTS: Record<BadgeVariant, string>;
19
- export declare const BADGE_SIZES: Record<BadgeSize, string>;
20
- export declare const BADGE_DOT_SIZES: Record<BadgeSize, string>;
21
- export declare const BADGE_DOT_VARIANTS: Record<BadgeVariant, string>;
22
- export declare function getBadgeVariantClasses(variant: BadgeVariant): string;
23
- export declare function getBadgeSizeClasses(size: BadgeSize): string;
24
- export declare function getBadgeDotSizeClasses(size: BadgeSize): string;
25
- export declare function getBadgeDotVariantClasses(variant: BadgeVariant): string;
26
- export type ButtonVariant = 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger' | 'success' | 'link';
27
- export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
28
- export declare const BUTTON_VARIANTS: Record<ButtonVariant, string>;
29
- export declare const BUTTON_SIZES: Record<ButtonSize, string>;
30
- export declare const BUTTON_ICON_SIZES: Record<ButtonSize, string>;
31
- export declare const BUTTON_BASE_CLASSES = "cursor-pointer inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:ring-offset-2";
32
- export declare function getButtonVariantClasses(variant: ButtonVariant): string;
33
- export declare function getButtonSizeClasses(size: ButtonSize, iconOnly: boolean): string;
34
- export type AlertVariant = 'info' | 'success' | 'warning' | 'danger' | 'neutral';
35
- export declare const ALERT_VARIANTS: Record<AlertVariant, {
36
- container: string;
37
- icon: string;
38
- }>;
39
- export declare const ALERT_BASE_CLASSES = "rounded-lg border p-4";
40
- export declare function getAlertVariantClasses(variant: AlertVariant): {
41
- container: string;
42
- icon: string;
43
- };
44
- export declare const ALERT_ICONS: Record<AlertVariant, string>;
45
- export declare const CLOSE_ICON = "<svg class=\"w-3 h-3\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M6 18L18 6M6 6l12 12\"/>\n</svg>";
46
- export declare const LOADING_SPINNER = "<svg class=\"animate-spin -ml-1 mr-2 h-4 w-4\" fill=\"none\" viewBox=\"0 0 24 24\">\n <circle class=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" stroke-width=\"4\"></circle>\n <path class=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"></path>\n</svg>";
47
- /**
48
- * Join CSS classes, filtering out falsy values
49
- */
50
- export declare function cn(...classes: (string | undefined | null | false)[]): string;
51
- //# sourceMappingURL=variants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../src/styles/variants.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GA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d.ts DELETED
@@ -1,195 +0,0 @@
1
- /**
2
- * @file cdn.ts
3
- * @description CDN Configuration for FrontMCP UI.
4
- *
5
- * Centralized configuration for all CDN resources used by FrontMCP UI.
6
- * All resources are loaded at runtime - no build step required.
7
- *
8
- * For platforms with blocked network (e.g., Claude Artifacts),
9
- * scripts can be fetched once and cached for inline injection.
10
- *
11
- * CDN URLs can be customized via theme configuration for:
12
- * - Using private CDN mirrors
13
- * - Self-hosting resources
14
- * - Compliance with CSP policies
15
- *
16
- * @example
17
- * ```typescript
18
- * import { buildCdnScriptsFromTheme, DEFAULT_THEME } from '@frontmcp/uipack/theme';
19
- *
20
- * // Use default CDN URLs
21
- * const scripts = buildCdnScripts();
22
- *
23
- * // Use theme-configured CDN URLs
24
- * const themedScripts = buildCdnScriptsFromTheme(DEFAULT_THEME);
25
- * ```
26
- *
27
- * @module @frontmcp/uipack/theme/cdn
28
- */
29
- import type { ThemeConfig } from './theme';
30
- /**
31
- * CDN resource configuration
32
- */
33
- export declare const CDN: {
34
- /**
35
- * Tailwind CSS v4 Browser CDN
36
- * Generates styles on-the-fly with @theme support
37
- * @see https://tailwindcss.com/docs/installation/play-cdn
38
- */
39
- readonly tailwind: "https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4";
40
- /**
41
- * HTMX 2.x - High power tools for HTML
42
- * Enables AJAX, WebSockets, Server Sent Events directly in HTML
43
- * @see https://htmx.org
44
- */
45
- readonly htmx: {
46
- readonly url: "https://cdnjs.cloudflare.com/ajax/libs/htmx/2.0.7/htmx.min.js";
47
- readonly integrity: "sha512-T6VLg/MJYMbLTmQ8VLvonbWg8VOvmDhXcOvHzCwo6ShdGuUU5SEcp1IAPXL4k9lVoMi8gRXl5K/S/zh43Y9rJA==";
48
- };
49
- /**
50
- * Alpine.js - Lightweight reactive framework
51
- * Used for more complex client-side interactions
52
- * @see https://alpinejs.dev
53
- */
54
- readonly alpine: {
55
- readonly url: "https://cdn.jsdelivr.net/npm/alpinejs@3.14.3/dist/cdn.min.js";
56
- readonly integrity: "sha384-6zY8MFQJ/EqS1r4RJl+7j8rvZPuBWpT0RzWf+IFcKhxqUzQNmJzA1X1VEVZhYaEz";
57
- };
58
- /**
59
- * Google Fonts - Inter for modern UI typography
60
- */
61
- readonly fonts: {
62
- readonly preconnect: readonly ["https://fonts.googleapis.com", "https://fonts.gstatic.com"];
63
- readonly inter: "https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap";
64
- readonly mono: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap";
65
- };
66
- /**
67
- * Lucide Icons - Beautiful & consistent icons
68
- * @see https://lucide.dev
69
- */
70
- readonly icons: {
71
- readonly url: "https://cdn.jsdelivr.net/npm/lucide@0.294.0/dist/umd/lucide.min.js";
72
- readonly integrity: "sha384-wpLmHb7v7V1LsEuTmPQ9tXqWZvTtRWWVqJuE+Yz6X0I6O2T6bHJVeXH1lVWqF4qE";
73
- };
74
- };
75
- /**
76
- * Fetch a script and cache its content
77
- */
78
- export declare function fetchScript(url: string): Promise<string>;
79
- /**
80
- * Fetch and cache all required scripts for offline use
81
- * Call this at startup to prepare for blocked-network platforms
82
- */
83
- export declare function fetchAndCacheScripts(options?: {
84
- tailwind?: boolean;
85
- htmx?: boolean;
86
- alpine?: boolean;
87
- icons?: boolean;
88
- }): Promise<Map<string, string>>;
89
- /**
90
- * Get cached script content
91
- */
92
- export declare function getCachedScript(url: string): string | undefined;
93
- /**
94
- * Check if a script is cached
95
- */
96
- export declare function isScriptCached(url: string): boolean;
97
- /**
98
- * Clear the script cache
99
- */
100
- export declare function clearScriptCache(): void;
101
- /**
102
- * Options for building CDN script tags
103
- */
104
- export interface CdnScriptOptions {
105
- /** Include Tailwind CSS (default: true) */
106
- tailwind?: boolean;
107
- /** Include HTMX (default: true) */
108
- htmx?: boolean;
109
- /** Include Alpine.js (default: false) */
110
- alpine?: boolean;
111
- /** Include Lucide icons (default: false) */
112
- icons?: boolean;
113
- /** Include Inter font (default: true) */
114
- interFont?: boolean;
115
- /** Include JetBrains Mono font (default: false) */
116
- monoFont?: boolean;
117
- /** Use inline scripts from cache (for blocked network) */
118
- inline?: boolean;
119
- }
120
- /**
121
- * Build font preconnect links
122
- */
123
- export declare function buildFontPreconnect(): string;
124
- /**
125
- * Build font stylesheet links
126
- */
127
- export declare function buildFontStylesheets(options?: {
128
- inter?: boolean;
129
- mono?: boolean;
130
- }): string;
131
- /**
132
- * Build all CDN script tags based on options
133
- *
134
- * @remarks
135
- * When `inline: true` is specified, scripts must be pre-cached via `fetchAndCacheScripts()`.
136
- * Uncached scripts will be silently skipped with a console warning.
137
- */
138
- export declare function buildCdnScripts(options?: CdnScriptOptions): string;
139
- /**
140
- * Options for theme-aware CDN script building
141
- */
142
- export interface ThemeCdnScriptOptions {
143
- /** Include Tailwind CSS (default: true) */
144
- tailwind?: boolean;
145
- /** Include HTMX (default: true) */
146
- htmx?: boolean;
147
- /** Include Alpine.js (default: false) */
148
- alpine?: boolean;
149
- /** Include icon library (default: false) */
150
- icons?: boolean;
151
- /** Use inline scripts from cache (for blocked network) */
152
- inline?: boolean;
153
- }
154
- /**
155
- * Build font preconnect links from theme CDN configuration
156
- *
157
- * @param theme - Theme configuration with CDN settings
158
- * @returns HTML preconnect link tags
159
- */
160
- export declare function buildFontPreconnectFromTheme(theme: ThemeConfig): string;
161
- /**
162
- * Build font stylesheet links from theme CDN configuration
163
- *
164
- * @param theme - Theme configuration with CDN settings
165
- * @returns HTML stylesheet link tags
166
- */
167
- export declare function buildFontStylesheetsFromTheme(theme: ThemeConfig): string;
168
- /**
169
- * Build all CDN script tags from theme configuration
170
- *
171
- * Uses theme.cdn configuration if available, falls back to global CDN defaults.
172
- *
173
- * @remarks
174
- * When `inline: true` is specified, scripts must be pre-cached via `fetchAndCacheScriptsFromTheme()`.
175
- * Uncached scripts will be silently skipped with a console warning.
176
- *
177
- * @param theme - Theme configuration with CDN settings
178
- * @param options - Script inclusion options
179
- * @returns HTML script tags
180
- */
181
- export declare function buildCdnScriptsFromTheme(theme: ThemeConfig, options?: ThemeCdnScriptOptions): string;
182
- /**
183
- * Fetch and cache scripts based on theme CDN configuration
184
- *
185
- * @param theme - Theme configuration with CDN settings
186
- * @param options - Which scripts to cache
187
- * @returns Map of cached script URLs to content
188
- */
189
- export declare function fetchAndCacheScriptsFromTheme(theme: ThemeConfig, options?: {
190
- tailwind?: boolean;
191
- htmx?: boolean;
192
- alpine?: boolean;
193
- icons?: boolean;
194
- }): Promise<Map<string, string>>;
195
- //# sourceMappingURL=cdn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cdn.d.ts","sourceRoot":"","sources":["../../src/theme/cdn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAM3C;;GAEG;AACH,eAAO,MAAM,GAAG;IACd;;;;OAIG;;IAGH;;;;OAIG;;;;;IAMH;;;;OAIG;;;;;IAMH;;OAEG;;;;;;IAOH;;;OAGG;;;;;CAKK,CAAC;AAYX;;GAEG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAc9D;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACZ,GACL,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAW9B;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE/D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;GAEG;AACH,wBAAgB,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,KAAK,EAAE,WAAW,EAAE,OAAO,GAAE,qBAA0B,GAAG,MAAM,CAsExG;AAED;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,KAAK,EAAE,WAAW,EAClB,OAAO,GAAE;IACP,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACZ,GACL,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAiB9B"}
@@ -1,64 +0,0 @@
1
- /**
2
- * @file css-to-theme.ts
3
- * @description Utility to convert user-provided CSS variables into Tailwind @theme block.
4
- *
5
- * When user provides a CSS string with --color-* variables in :root,
6
- * this utility extracts them and converts to a @theme block that
7
- * Tailwind v4 can process to create native utility classes.
8
- *
9
- * @example
10
- * ```typescript
11
- * import { cssToTailwindTheme } from '@frontmcp/uipack/theme';
12
- *
13
- * const userCss = `:root {
14
- * --color-primary: #0556b2;
15
- * --color-success: #10b981;
16
- * --font-family: Inter;
17
- * }`;
18
- *
19
- * const { themeBlock, remainingCss } = cssToTailwindTheme(userCss);
20
- * // themeBlock: "@theme { --color-primary: #0556b2; --color-success: #10b981; }"
21
- * // remainingCss: CSS without --color-* variables
22
- * ```
23
- *
24
- * @module @frontmcp/uipack/theme/css-to-theme
25
- */
26
- /**
27
- * Result of converting CSS to Tailwind theme.
28
- */
29
- export interface CssToThemeResult {
30
- /**
31
- * The @theme block containing color variables.
32
- * Can be placed inside <style type="text/tailwindcss">.
33
- * Empty string if no color variables found.
34
- */
35
- themeBlock: string;
36
- /**
37
- * The remaining CSS after removing --color-* variables.
38
- * Can be placed in a regular <style> tag.
39
- */
40
- remainingCss: string;
41
- /**
42
- * Map of extracted color variable names to their values.
43
- * Useful for debugging or further processing.
44
- */
45
- colorVars: Map<string, string>;
46
- }
47
- export declare function cssToTailwindTheme(userCss: string): CssToThemeResult;
48
- /**
49
- * Build a complete Tailwind style block from user CSS.
50
- *
51
- * Combines the @theme block and remaining CSS into a single
52
- * <style type="text/tailwindcss"> block.
53
- *
54
- * @param userCss - CSS string containing :root with --color-* variables
55
- * @returns HTML style tag with @theme and remaining CSS
56
- *
57
- * @example
58
- * ```typescript
59
- * const styleTag = buildTailwindStyleBlock(userCss);
60
- * // Returns: <style type="text/tailwindcss">@theme {...}\n:root {...}</style>
61
- * ```
62
- */
63
- export declare function buildTailwindStyleBlock(userCss: string): string;
64
- //# sourceMappingURL=css-to-theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"css-to-theme.d.ts","sourceRoot":"","sources":["../../src/theme/css-to-theme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAwCD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAoCpE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAU/D"}
package/theme/index.d.ts DELETED
@@ -1,19 +0,0 @@
1
- /**
2
- * @file index.ts
3
- * @description Theme Module for FrontMCP UI.
4
- *
5
- * Provides comprehensive theming capabilities including:
6
- * - Color palettes and semantic tokens
7
- * - Typography and spacing configuration
8
- * - CDN resource customization
9
- * - Platform-specific configurations
10
- * - Theme presets (GitHub/OpenAI default)
11
- *
12
- * @module @frontmcp/ui/theme
13
- */
14
- export { CDN, type CdnScriptOptions, type ThemeCdnScriptOptions, fetchScript, fetchAndCacheScripts, fetchAndCacheScriptsFromTheme, getCachedScript, isScriptCached, clearScriptCache, buildFontPreconnect, buildFontPreconnectFromTheme, buildFontStylesheets, buildFontStylesheetsFromTheme, buildCdnScripts, buildCdnScriptsFromTheme, } from './cdn';
15
- export { type PlatformId, type NetworkMode, type ScriptStrategy, type PlatformCapabilities, OPENAI_PLATFORM, CLAUDE_PLATFORM, GEMINI_PLATFORM, CUSTOM_PLATFORM, PLATFORM_PRESETS, getPlatform, createPlatform, canUseCdn, needsInlineScripts, supportsFullInteractivity, getFallbackMode, } from './platforms';
16
- export { type DeepPartial, type ColorScale, type SemanticColors, type SurfaceColors, type TextColors, type BorderColors, type ThemeColors, type FontFamilies, type FontSizes, type FontWeights, type ThemeTypography, type ThemeSpacing, type ThemeRadius, type ThemeShadows, type ButtonTokens, type CardTokens, type InputTokens, type ComponentTokens, type CdnScriptResource, type ThemeCdnFonts, type ThemeCdnIcons, type ThemeCdnScripts, type ThemeCdnConfig, type ThemeConfig, mergeThemes, createTheme, buildThemeCss, buildStyleBlock, } from './theme';
17
- export { GITHUB_OPENAI_THEME, DEFAULT_THEME } from './presets';
18
- export { type CssToThemeResult, cssToTailwindTheme, buildTailwindStyleBlock } from './css-to-theme';
19
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EACL,GAAG,EACH,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,WAAW,EACX,oBAAoB,EACpB,6BAA6B,EAC7B,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,4BAA4B,EAC5B,oBAAoB,EACpB,6BAA6B,EAC7B,eAAe,EACf,wBAAwB,GACzB,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,eAAe,EACf,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,E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