@frontmcp/ui 0.6.1 → 0.6.2

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 (292) hide show
  1. package/bridge/core/bridge-factory.d.ts +1 -0
  2. package/bridge/core/bridge-factory.d.ts.map +1 -1
  3. package/bridge/index.d.ts +1 -1
  4. package/bridge/index.d.ts.map +1 -1
  5. package/bridge/index.js +39 -881
  6. package/bundler/browser-components.d.ts +42 -0
  7. package/bundler/browser-components.d.ts.map +1 -0
  8. package/bundler/bundler.d.ts +78 -4
  9. package/bundler/bundler.d.ts.map +1 -1
  10. package/bundler/index.d.ts +8 -8
  11. package/bundler/index.d.ts.map +1 -1
  12. package/bundler/index.js +1315 -1854
  13. package/bundler/types.d.ts +188 -7
  14. package/bundler/types.d.ts.map +1 -1
  15. package/esm/bridge/{index.js → index.mjs} +40 -877
  16. package/esm/bundler/{index.js → index.mjs} +1391 -1895
  17. package/esm/{index.js → index.mjs} +215 -3091
  18. package/esm/layouts/{index.js → index.mjs} +3 -3
  19. package/esm/package.json +9 -8
  20. package/esm/react/index.mjs +1183 -0
  21. package/esm/renderers/index.mjs +611 -0
  22. package/esm/universal/{index.js → index.mjs} +266 -70
  23. package/index.d.ts +1 -4
  24. package/index.d.ts.map +1 -1
  25. package/index.js +208 -3113
  26. package/layouts/base.d.ts.map +1 -1
  27. package/layouts/index.js +3 -3
  28. package/layouts/presets.d.ts.map +1 -1
  29. package/package.json +9 -8
  30. package/react/Badge.d.ts.map +1 -1
  31. package/react/hooks/context.d.ts.map +1 -1
  32. package/react/index.d.ts +0 -1
  33. package/react/index.d.ts.map +1 -1
  34. package/react/index.js +57 -2001
  35. package/react/types.d.ts.map +1 -1
  36. package/renderers/index.d.ts +9 -4
  37. package/renderers/index.d.ts.map +1 -1
  38. package/renderers/index.js +328 -88
  39. package/renderers/mdx.renderer.d.ts +99 -0
  40. package/renderers/mdx.renderer.d.ts.map +1 -0
  41. package/renderers/react.renderer.d.ts +22 -13
  42. package/renderers/react.renderer.d.ts.map +1 -1
  43. package/renderers/transpiler.d.ts +49 -0
  44. package/renderers/transpiler.d.ts.map +1 -0
  45. package/universal/cached-runtime.d.ts +25 -1
  46. package/universal/cached-runtime.d.ts.map +1 -1
  47. package/universal/index.js +266 -70
  48. package/universal/runtime-builder.d.ts.map +1 -1
  49. package/universal/types.d.ts.map +1 -1
  50. package/web-components/elements/fmcp-input.d.ts.map +1 -1
  51. package/web-components/elements/fmcp-select.d.ts.map +1 -1
  52. package/web-components/index.d.ts +0 -1
  53. package/web-components/index.d.ts.map +1 -1
  54. package/bundler/cache.d.ts +0 -173
  55. package/bundler/cache.d.ts.map +0 -1
  56. package/bundler/file-cache/component-builder.d.ts +0 -167
  57. package/bundler/file-cache/component-builder.d.ts.map +0 -1
  58. package/bundler/file-cache/hash-calculator.d.ts +0 -155
  59. package/bundler/file-cache/hash-calculator.d.ts.map +0 -1
  60. package/bundler/file-cache/index.d.ts +0 -12
  61. package/bundler/file-cache/index.d.ts.map +0 -1
  62. package/bundler/file-cache/storage/filesystem.d.ts +0 -149
  63. package/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
  64. package/bundler/file-cache/storage/index.d.ts +0 -11
  65. package/bundler/file-cache/storage/index.d.ts.map +0 -1
  66. package/bundler/file-cache/storage/interface.d.ts +0 -152
  67. package/bundler/file-cache/storage/interface.d.ts.map +0 -1
  68. package/bundler/file-cache/storage/redis.d.ts +0 -139
  69. package/bundler/file-cache/storage/redis.d.ts.map +0 -1
  70. package/bundler/sandbox/enclave-adapter.d.ts +0 -121
  71. package/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
  72. package/bundler/sandbox/executor.d.ts +0 -14
  73. package/bundler/sandbox/executor.d.ts.map +0 -1
  74. package/bundler/sandbox/policy.d.ts +0 -62
  75. package/bundler/sandbox/policy.d.ts.map +0 -1
  76. package/esm/bridge/adapters/base-adapter.d.ts +0 -104
  77. package/esm/bridge/adapters/base-adapter.d.ts.map +0 -1
  78. package/esm/bridge/adapters/claude.adapter.d.ts +0 -67
  79. package/esm/bridge/adapters/claude.adapter.d.ts.map +0 -1
  80. package/esm/bridge/adapters/ext-apps.adapter.d.ts +0 -143
  81. package/esm/bridge/adapters/ext-apps.adapter.d.ts.map +0 -1
  82. package/esm/bridge/adapters/gemini.adapter.d.ts +0 -64
  83. package/esm/bridge/adapters/gemini.adapter.d.ts.map +0 -1
  84. package/esm/bridge/adapters/generic.adapter.d.ts +0 -56
  85. package/esm/bridge/adapters/generic.adapter.d.ts.map +0 -1
  86. package/esm/bridge/adapters/index.d.ts +0 -26
  87. package/esm/bridge/adapters/index.d.ts.map +0 -1
  88. package/esm/bridge/adapters/openai.adapter.d.ts +0 -65
  89. package/esm/bridge/adapters/openai.adapter.d.ts.map +0 -1
  90. package/esm/bridge/core/adapter-registry.d.ts +0 -122
  91. package/esm/bridge/core/adapter-registry.d.ts.map +0 -1
  92. package/esm/bridge/core/bridge-factory.d.ts +0 -199
  93. package/esm/bridge/core/bridge-factory.d.ts.map +0 -1
  94. package/esm/bridge/core/index.d.ts +0 -10
  95. package/esm/bridge/core/index.d.ts.map +0 -1
  96. package/esm/bridge/index.d.ts +0 -62
  97. package/esm/bridge/index.d.ts.map +0 -1
  98. package/esm/bridge/runtime/iife-generator.d.ts +0 -62
  99. package/esm/bridge/runtime/iife-generator.d.ts.map +0 -1
  100. package/esm/bridge/runtime/index.d.ts +0 -10
  101. package/esm/bridge/runtime/index.d.ts.map +0 -1
  102. package/esm/bridge/types.d.ts +0 -386
  103. package/esm/bridge/types.d.ts.map +0 -1
  104. package/esm/bundler/bundler.d.ts +0 -208
  105. package/esm/bundler/bundler.d.ts.map +0 -1
  106. package/esm/bundler/cache.d.ts +0 -173
  107. package/esm/bundler/cache.d.ts.map +0 -1
  108. package/esm/bundler/file-cache/component-builder.d.ts +0 -167
  109. package/esm/bundler/file-cache/component-builder.d.ts.map +0 -1
  110. package/esm/bundler/file-cache/hash-calculator.d.ts +0 -155
  111. package/esm/bundler/file-cache/hash-calculator.d.ts.map +0 -1
  112. package/esm/bundler/file-cache/index.d.ts +0 -12
  113. package/esm/bundler/file-cache/index.d.ts.map +0 -1
  114. package/esm/bundler/file-cache/storage/filesystem.d.ts +0 -149
  115. package/esm/bundler/file-cache/storage/filesystem.d.ts.map +0 -1
  116. package/esm/bundler/file-cache/storage/index.d.ts +0 -11
  117. package/esm/bundler/file-cache/storage/index.d.ts.map +0 -1
  118. package/esm/bundler/file-cache/storage/interface.d.ts +0 -152
  119. package/esm/bundler/file-cache/storage/interface.d.ts.map +0 -1
  120. package/esm/bundler/file-cache/storage/redis.d.ts +0 -139
  121. package/esm/bundler/file-cache/storage/redis.d.ts.map +0 -1
  122. package/esm/bundler/index.d.ts +0 -43
  123. package/esm/bundler/index.d.ts.map +0 -1
  124. package/esm/bundler/sandbox/enclave-adapter.d.ts +0 -121
  125. package/esm/bundler/sandbox/enclave-adapter.d.ts.map +0 -1
  126. package/esm/bundler/sandbox/executor.d.ts +0 -14
  127. package/esm/bundler/sandbox/executor.d.ts.map +0 -1
  128. package/esm/bundler/sandbox/policy.d.ts +0 -62
  129. package/esm/bundler/sandbox/policy.d.ts.map +0 -1
  130. package/esm/bundler/types.d.ts +0 -702
  131. package/esm/bundler/types.d.ts.map +0 -1
  132. package/esm/components/alert.d.ts +0 -66
  133. package/esm/components/alert.d.ts.map +0 -1
  134. package/esm/components/alert.schema.d.ts +0 -98
  135. package/esm/components/alert.schema.d.ts.map +0 -1
  136. package/esm/components/avatar.d.ts +0 -77
  137. package/esm/components/avatar.d.ts.map +0 -1
  138. package/esm/components/avatar.schema.d.ts +0 -170
  139. package/esm/components/avatar.schema.d.ts.map +0 -1
  140. package/esm/components/badge.d.ts +0 -64
  141. package/esm/components/badge.d.ts.map +0 -1
  142. package/esm/components/badge.schema.d.ts +0 -91
  143. package/esm/components/badge.schema.d.ts.map +0 -1
  144. package/esm/components/button.d.ts +0 -100
  145. package/esm/components/button.d.ts.map +0 -1
  146. package/esm/components/button.schema.d.ts +0 -120
  147. package/esm/components/button.schema.d.ts.map +0 -1
  148. package/esm/components/card.d.ts +0 -53
  149. package/esm/components/card.d.ts.map +0 -1
  150. package/esm/components/card.schema.d.ts +0 -93
  151. package/esm/components/card.schema.d.ts.map +0 -1
  152. package/esm/components/form.d.ts +0 -212
  153. package/esm/components/form.d.ts.map +0 -1
  154. package/esm/components/form.schema.d.ts +0 -365
  155. package/esm/components/form.schema.d.ts.map +0 -1
  156. package/esm/components/index.d.ts +0 -29
  157. package/esm/components/index.d.ts.map +0 -1
  158. package/esm/components/list.d.ts +0 -121
  159. package/esm/components/list.d.ts.map +0 -1
  160. package/esm/components/list.schema.d.ts +0 -129
  161. package/esm/components/list.schema.d.ts.map +0 -1
  162. package/esm/components/modal.d.ts +0 -100
  163. package/esm/components/modal.d.ts.map +0 -1
  164. package/esm/components/modal.schema.d.ts +0 -151
  165. package/esm/components/modal.schema.d.ts.map +0 -1
  166. package/esm/components/table.d.ts +0 -91
  167. package/esm/components/table.d.ts.map +0 -1
  168. package/esm/components/table.schema.d.ts +0 -123
  169. package/esm/components/table.schema.d.ts.map +0 -1
  170. package/esm/index.d.ts +0 -40
  171. package/esm/index.d.ts.map +0 -1
  172. package/esm/layouts/base.d.ts +0 -86
  173. package/esm/layouts/base.d.ts.map +0 -1
  174. package/esm/layouts/index.d.ts +0 -8
  175. package/esm/layouts/index.d.ts.map +0 -1
  176. package/esm/layouts/presets.d.ts +0 -134
  177. package/esm/layouts/presets.d.ts.map +0 -1
  178. package/esm/pages/consent.d.ts +0 -117
  179. package/esm/pages/consent.d.ts.map +0 -1
  180. package/esm/pages/error.d.ts +0 -101
  181. package/esm/pages/error.d.ts.map +0 -1
  182. package/esm/pages/index.d.ts +0 -9
  183. package/esm/pages/index.d.ts.map +0 -1
  184. package/esm/pages/index.js +0 -1036
  185. package/esm/react/Alert.d.ts +0 -101
  186. package/esm/react/Alert.d.ts.map +0 -1
  187. package/esm/react/Badge.d.ts +0 -100
  188. package/esm/react/Badge.d.ts.map +0 -1
  189. package/esm/react/Button.d.ts +0 -108
  190. package/esm/react/Button.d.ts.map +0 -1
  191. package/esm/react/Card.d.ts +0 -103
  192. package/esm/react/Card.d.ts.map +0 -1
  193. package/esm/react/hooks/context.d.ts +0 -179
  194. package/esm/react/hooks/context.d.ts.map +0 -1
  195. package/esm/react/hooks/index.d.ts +0 -42
  196. package/esm/react/hooks/index.d.ts.map +0 -1
  197. package/esm/react/hooks/tools.d.ts +0 -284
  198. package/esm/react/hooks/tools.d.ts.map +0 -1
  199. package/esm/react/index.d.ts +0 -80
  200. package/esm/react/index.d.ts.map +0 -1
  201. package/esm/react/index.js +0 -3124
  202. package/esm/react/types.d.ts +0 -105
  203. package/esm/react/types.d.ts.map +0 -1
  204. package/esm/react/utils.d.ts +0 -43
  205. package/esm/react/utils.d.ts.map +0 -1
  206. package/esm/render/index.d.ts +0 -8
  207. package/esm/render/index.d.ts.map +0 -1
  208. package/esm/render/prerender.d.ts +0 -57
  209. package/esm/render/prerender.d.ts.map +0 -1
  210. package/esm/renderers/index.d.ts +0 -21
  211. package/esm/renderers/index.d.ts.map +0 -1
  212. package/esm/renderers/index.js +0 -381
  213. package/esm/renderers/react.adapter.d.ts +0 -70
  214. package/esm/renderers/react.adapter.d.ts.map +0 -1
  215. package/esm/renderers/react.renderer.d.ts +0 -96
  216. package/esm/renderers/react.renderer.d.ts.map +0 -1
  217. package/esm/universal/UniversalApp.d.ts +0 -108
  218. package/esm/universal/UniversalApp.d.ts.map +0 -1
  219. package/esm/universal/cached-runtime.d.ts +0 -115
  220. package/esm/universal/cached-runtime.d.ts.map +0 -1
  221. package/esm/universal/context.d.ts +0 -122
  222. package/esm/universal/context.d.ts.map +0 -1
  223. package/esm/universal/index.d.ts +0 -57
  224. package/esm/universal/index.d.ts.map +0 -1
  225. package/esm/universal/renderers/html.renderer.d.ts +0 -37
  226. package/esm/universal/renderers/html.renderer.d.ts.map +0 -1
  227. package/esm/universal/renderers/index.d.ts +0 -112
  228. package/esm/universal/renderers/index.d.ts.map +0 -1
  229. package/esm/universal/renderers/markdown.renderer.d.ts +0 -33
  230. package/esm/universal/renderers/markdown.renderer.d.ts.map +0 -1
  231. package/esm/universal/renderers/mdx.renderer.d.ts +0 -38
  232. package/esm/universal/renderers/mdx.renderer.d.ts.map +0 -1
  233. package/esm/universal/renderers/react.renderer.d.ts +0 -46
  234. package/esm/universal/renderers/react.renderer.d.ts.map +0 -1
  235. package/esm/universal/runtime-builder.d.ts +0 -33
  236. package/esm/universal/runtime-builder.d.ts.map +0 -1
  237. package/esm/universal/store.d.ts +0 -135
  238. package/esm/universal/store.d.ts.map +0 -1
  239. package/esm/universal/types.d.ts +0 -199
  240. package/esm/universal/types.d.ts.map +0 -1
  241. package/esm/web-components/core/attribute-parser.d.ts +0 -82
  242. package/esm/web-components/core/attribute-parser.d.ts.map +0 -1
  243. package/esm/web-components/core/base-element.d.ts +0 -197
  244. package/esm/web-components/core/base-element.d.ts.map +0 -1
  245. package/esm/web-components/core/index.d.ts +0 -9
  246. package/esm/web-components/core/index.d.ts.map +0 -1
  247. package/esm/web-components/elements/fmcp-alert.d.ts +0 -46
  248. package/esm/web-components/elements/fmcp-alert.d.ts.map +0 -1
  249. package/esm/web-components/elements/fmcp-badge.d.ts +0 -47
  250. package/esm/web-components/elements/fmcp-badge.d.ts.map +0 -1
  251. package/esm/web-components/elements/fmcp-button.d.ts +0 -117
  252. package/esm/web-components/elements/fmcp-button.d.ts.map +0 -1
  253. package/esm/web-components/elements/fmcp-card.d.ts +0 -53
  254. package/esm/web-components/elements/fmcp-card.d.ts.map +0 -1
  255. package/esm/web-components/elements/fmcp-input.d.ts +0 -96
  256. package/esm/web-components/elements/fmcp-input.d.ts.map +0 -1
  257. package/esm/web-components/elements/fmcp-select.d.ts +0 -100
  258. package/esm/web-components/elements/fmcp-select.d.ts.map +0 -1
  259. package/esm/web-components/elements/index.d.ts +0 -13
  260. package/esm/web-components/elements/index.d.ts.map +0 -1
  261. package/esm/web-components/index.d.ts +0 -50
  262. package/esm/web-components/index.d.ts.map +0 -1
  263. package/esm/web-components/register.d.ts +0 -57
  264. package/esm/web-components/register.d.ts.map +0 -1
  265. package/esm/web-components/types.d.ts +0 -122
  266. package/esm/web-components/types.d.ts.map +0 -1
  267. package/esm/widgets/index.d.ts +0 -8
  268. package/esm/widgets/index.d.ts.map +0 -1
  269. package/esm/widgets/index.js +0 -883
  270. package/esm/widgets/progress.d.ts +0 -133
  271. package/esm/widgets/progress.d.ts.map +0 -1
  272. package/esm/widgets/resource.d.ts +0 -163
  273. package/esm/widgets/resource.d.ts.map +0 -1
  274. package/pages/consent.d.ts +0 -117
  275. package/pages/consent.d.ts.map +0 -1
  276. package/pages/error.d.ts +0 -101
  277. package/pages/error.d.ts.map +0 -1
  278. package/pages/index.d.ts +0 -9
  279. package/pages/index.d.ts.map +0 -1
  280. package/pages/index.js +0 -1065
  281. package/react/utils.d.ts +0 -43
  282. package/react/utils.d.ts.map +0 -1
  283. package/widgets/index.d.ts +0 -8
  284. package/widgets/index.d.ts.map +0 -1
  285. package/widgets/index.js +0 -910
  286. package/widgets/progress.d.ts +0 -133
  287. package/widgets/progress.d.ts.map +0 -1
  288. package/widgets/resource.d.ts +0 -163
  289. package/widgets/resource.d.ts.map +0 -1
  290. /package/esm/components/{index.js → index.mjs} +0 -0
  291. /package/esm/render/{index.js → index.mjs} +0 -0
  292. /package/esm/web-components/{index.js → index.mjs} +0 -0
@@ -1,101 +0,0 @@
1
- /**
2
- * @file Alert.tsx
3
- * @description React Alert component with static HTML rendering support.
4
- *
5
- * This is the single source of truth for the Alert component. It can be used:
6
- * 1. As a React component: `<Alert variant="success" title="Success!">Message</Alert>`
7
- * 2. As a static HTML generator: `await renderAlert({ variant: 'success', children: 'Message' })`
8
- *
9
- * @example React usage
10
- * ```tsx
11
- * import { Alert } from '@frontmcp/ui/react';
12
- *
13
- * function App() {
14
- * return (
15
- * <Alert variant="success" title="Success!">
16
- * Your changes have been saved.
17
- * </Alert>
18
- * );
19
- * }
20
- * ```
21
- *
22
- * @example Dismissible alert
23
- * ```tsx
24
- * <Alert variant="warning" dismissible onDismiss={() => setShow(false)}>
25
- * This action cannot be undone.
26
- * </Alert>
27
- * ```
28
- *
29
- * @example Static HTML generation
30
- * ```typescript
31
- * import { renderAlert } from '@frontmcp/ui/react';
32
- *
33
- * const html = await renderAlert({
34
- * variant: 'info',
35
- * title: 'Note',
36
- * children: 'Please review before submitting.',
37
- * });
38
- * ```
39
- *
40
- * @module @frontmcp/ui/react/Alert
41
- */
42
- import type { ReactNode, ReactElement } from 'react';
43
- import { type AlertVariant } from '@frontmcp/uipack/styles';
44
- /**
45
- * Alert component props
46
- */
47
- export interface AlertProps {
48
- /** Alert variant */
49
- variant?: AlertVariant;
50
- /** Alert title */
51
- title?: string;
52
- /** Custom icon (React element) */
53
- icon?: ReactNode;
54
- /** Show default icon based on variant */
55
- showIcon?: boolean;
56
- /** Dismissible alert */
57
- dismissible?: boolean;
58
- /** Dismiss callback */
59
- onDismiss?: () => void;
60
- /** Additional CSS classes */
61
- className?: string;
62
- /** Alert content */
63
- children?: ReactNode;
64
- }
65
- /**
66
- * Alert component.
67
- *
68
- * A notification component for displaying important messages.
69
- * Uses Tailwind CSS classes for styling.
70
- */
71
- export declare function Alert({ variant, title, icon, showIcon, dismissible, onDismiss, className, children, }: AlertProps): ReactElement;
72
- /**
73
- * Props for static render functions (children is always a string)
74
- */
75
- export interface AlertRenderProps extends Omit<AlertProps, 'children' | 'icon' | 'onDismiss'> {
76
- /** Alert content as string */
77
- children?: string;
78
- /** Icon as HTML string */
79
- icon?: string;
80
- }
81
- /**
82
- * Render Alert component to static HTML string (async).
83
- *
84
- * Uses React 19's prerender API for optimal static HTML generation.
85
- *
86
- * @param props - Alert props (with string children)
87
- * @returns Promise resolving to HTML string
88
- */
89
- export declare function renderAlert(props: AlertRenderProps): Promise<string>;
90
- /**
91
- * Render Alert component to static HTML string (sync).
92
- *
93
- * Uses React's renderToStaticMarkup for synchronous rendering.
94
- * Does NOT wait for Suspense boundaries.
95
- *
96
- * @param props - Alert props (with string children)
97
- * @returns HTML string
98
- */
99
- export declare function renderAlertSync(props: AlertRenderProps): string;
100
- export default Alert;
101
- //# sourceMappingURL=Alert.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Alert.d.ts","sourceRoot":"","sources":["../../../src/react/Alert.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,KAAK,YAAY,EAMlB,MAAM,yBAAyB,CAAC;AAGjC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,oBAAoB;IACpB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wBAAwB;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,EACpB,OAAgB,EAChB,KAAK,EACL,IAAI,EACJ,QAAe,EACf,WAAmB,EACnB,SAAS,EACT,SAAS,EACT,QAAQ,GACT,EAAE,UAAU,GAAG,YAAY,CAoC3B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;IAC3F,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAQ/D;AAID,eAAe,KAAK,CAAC"}
@@ -1,100 +0,0 @@
1
- /**
2
- * @file Badge.tsx
3
- * @description React Badge component with static HTML rendering support.
4
- *
5
- * This is the single source of truth for the Badge component. It can be used:
6
- * 1. As a React component: `<Badge variant="success">Active</Badge>`
7
- * 2. As a static HTML generator: `await renderBadge({ variant: 'success', children: 'Active' })`
8
- *
9
- * @example React usage
10
- * ```tsx
11
- * import { Badge } from '@frontmcp/ui/react';
12
- *
13
- * function App() {
14
- * return (
15
- * <Badge variant="success">Active</Badge>
16
- * );
17
- * }
18
- * ```
19
- *
20
- * @example Pill badge
21
- * ```tsx
22
- * <Badge variant="info" pill>
23
- * New Feature
24
- * </Badge>
25
- * ```
26
- *
27
- * @example Static HTML generation
28
- * ```typescript
29
- * import { renderBadge } from '@frontmcp/ui/react';
30
- *
31
- * const html = await renderBadge({
32
- * variant: 'success',
33
- * children: 'Active',
34
- * });
35
- * ```
36
- *
37
- * @module @frontmcp/ui/react/Badge
38
- */
39
- import type { ReactNode, ReactElement } from 'react';
40
- import { type BadgeVariant, type BadgeSize } from '@frontmcp/uipack/styles';
41
- /**
42
- * Badge component props
43
- */
44
- export interface BadgeProps {
45
- /** Badge variant */
46
- variant?: BadgeVariant;
47
- /** Badge size */
48
- size?: BadgeSize;
49
- /** Rounded pill style */
50
- pill?: boolean;
51
- /** Icon before text (React element) */
52
- icon?: ReactNode;
53
- /** Dot indicator (no text) */
54
- dot?: boolean;
55
- /** Additional CSS classes */
56
- className?: string;
57
- /** Removable badge */
58
- removable?: boolean;
59
- /** Remove callback */
60
- onRemove?: () => void;
61
- /** Badge content */
62
- children?: ReactNode;
63
- }
64
- /**
65
- * Badge component.
66
- *
67
- * A small status indicator or label component.
68
- * Uses Tailwind CSS classes for styling.
69
- */
70
- export declare function Badge({ variant, size, pill, icon, dot, className, removable, onRemove, children, }: BadgeProps): ReactElement;
71
- /**
72
- * Props for static render functions (children is always a string)
73
- */
74
- export interface BadgeRenderProps extends Omit<BadgeProps, 'children' | 'icon' | 'onRemove'> {
75
- /** Badge content as string */
76
- children?: string;
77
- /** Icon as HTML string */
78
- icon?: string;
79
- }
80
- /**
81
- * Render Badge component to static HTML string (async).
82
- *
83
- * Uses React 19's prerender API for optimal static HTML generation.
84
- *
85
- * @param props - Badge props (with string children)
86
- * @returns Promise resolving to HTML string
87
- */
88
- export declare function renderBadge(props: BadgeRenderProps): Promise<string>;
89
- /**
90
- * Render Badge component to static HTML string (sync).
91
- *
92
- * Uses React's renderToStaticMarkup for synchronous rendering.
93
- * Does NOT wait for Suspense boundaries.
94
- *
95
- * @param props - Badge props (with string children)
96
- * @returns HTML string
97
- */
98
- export declare function renderBadgeSync(props: BadgeRenderProps): string;
99
- export default Badge;
100
- //# sourceMappingURL=Badge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../../../src/react/Badge.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAOf,MAAM,yBAAyB,CAAC;AAGjC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,oBAAoB;IACpB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,iBAAiB;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,yBAAyB;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,8BAA8B;IAC9B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,EACpB,OAAmB,EACnB,IAAW,EACX,IAAY,EACZ,IAAI,EACJ,GAAW,EACX,SAAS,EACT,SAAiB,EACjB,QAAQ,EACR,QAAQ,GACT,EAAE,UAAU,GAAG,YAAY,CA4C3B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC;IAC1F,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAQ/D;AAID,eAAe,KAAK,CAAC"}
@@ -1,108 +0,0 @@
1
- /**
2
- * @file Button.tsx
3
- * @description React Button component with static HTML rendering support.
4
- *
5
- * This is the single source of truth for the Button component. It can be used:
6
- * 1. As a React component: `<Button variant="primary">Click Me</Button>`
7
- * 2. As a static HTML generator: `await renderButton({ variant: 'primary', children: 'Click Me' })`
8
- *
9
- * @example React usage
10
- * ```tsx
11
- * import { Button } from '@frontmcp/ui/react';
12
- *
13
- * function App() {
14
- * return (
15
- * <Button variant="primary" onClick={() => alert('Clicked!')}>
16
- * Click Me
17
- * </Button>
18
- * );
19
- * }
20
- * ```
21
- *
22
- * @example With loading state
23
- * ```tsx
24
- * <Button variant="primary" loading>
25
- * Saving...
26
- * </Button>
27
- * ```
28
- *
29
- * @example Static HTML generation
30
- * ```typescript
31
- * import { renderButton } from '@frontmcp/ui/react';
32
- *
33
- * const html = await renderButton({
34
- * variant: 'primary',
35
- * children: 'Submit',
36
- * });
37
- * ```
38
- *
39
- * @module @frontmcp/ui/react/Button
40
- */
41
- import type { ReactNode, ReactElement } from 'react';
42
- import { type ButtonVariant, type ButtonSize } from '@frontmcp/uipack/styles';
43
- /**
44
- * Button component props
45
- */
46
- export interface ButtonProps {
47
- /** Button variant */
48
- variant?: ButtonVariant;
49
- /** Button size */
50
- size?: ButtonSize;
51
- /** Disabled state */
52
- disabled?: boolean;
53
- /** Loading state */
54
- loading?: boolean;
55
- /** Full width */
56
- fullWidth?: boolean;
57
- /** Icon position */
58
- iconPosition?: 'left' | 'right';
59
- /** Icon content (React element) */
60
- icon?: ReactNode;
61
- /** Icon only (no text) */
62
- iconOnly?: boolean;
63
- /** Button type */
64
- type?: 'button' | 'submit' | 'reset';
65
- /** Additional CSS classes */
66
- className?: string;
67
- /** Click handler */
68
- onClick?: () => void;
69
- /** Button content */
70
- children?: ReactNode;
71
- }
72
- /**
73
- * Button component.
74
- *
75
- * A versatile button component with multiple variants, sizes, and states.
76
- * Uses Tailwind CSS classes for styling.
77
- */
78
- export declare function Button({ variant, size, disabled, loading, fullWidth, iconPosition, icon, iconOnly, type, className, onClick, children, }: ButtonProps): ReactElement;
79
- /**
80
- * Props for static render functions (children is always a string)
81
- */
82
- export interface ButtonRenderProps extends Omit<ButtonProps, 'children' | 'icon' | 'onClick'> {
83
- /** Button content as string */
84
- children?: string;
85
- /** Icon as HTML string */
86
- icon?: string;
87
- }
88
- /**
89
- * Render Button component to static HTML string (async).
90
- *
91
- * Uses React 19's prerender API for optimal static HTML generation.
92
- *
93
- * @param props - Button props (with string children)
94
- * @returns Promise resolving to HTML string
95
- */
96
- export declare function renderButton(props: ButtonRenderProps): Promise<string>;
97
- /**
98
- * Render Button component to static HTML string (sync).
99
- *
100
- * Uses React's renderToStaticMarkup for synchronous rendering.
101
- * Does NOT wait for Suspense boundaries.
102
- *
103
- * @param props - Button props (with string children)
104
- * @returns HTML string
105
- */
106
- export declare function renderButtonSync(props: ButtonRenderProps): string;
107
- export default Button;
108
- //# sourceMappingURL=Button.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/react/Button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,UAAU,EAMhB,MAAM,yBAAyB,CAAC;AAGjC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qBAAqB;IACrB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,kBAAkB;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,mCAAmC;IACnC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,EACrB,OAAmB,EACnB,IAAW,EACX,QAAgB,EAChB,OAAe,EACf,SAAiB,EACjB,YAAqB,EACrB,IAAI,EACJ,QAAgB,EAChB,IAAe,EACf,SAAS,EACT,OAAO,EACP,QAAQ,GACT,EAAE,WAAW,GAAG,YAAY,CAmB5B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;IAC3F,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQ5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAQjE;AAID,eAAe,MAAM,CAAC"}
@@ -1,103 +0,0 @@
1
- /**
2
- * @file Card.tsx
3
- * @description React Card component with static HTML rendering support.
4
- *
5
- * This is the single source of truth for the Card component. It can be used:
6
- * 1. As a React component: `<Card title="Hello">Content</Card>`
7
- * 2. As a static HTML generator: `await renderCard({ title: 'Hello', children: 'Content' })`
8
- *
9
- * @example React usage
10
- * ```tsx
11
- * import { Card } from '@frontmcp/ui/react';
12
- *
13
- * function App() {
14
- * return (
15
- * <Card title="Welcome" variant="elevated">
16
- * <p>Card content goes here</p>
17
- * </Card>
18
- * );
19
- * }
20
- * ```
21
- *
22
- * @example Static HTML generation
23
- * ```typescript
24
- * import { renderCard } from '@frontmcp/ui/react';
25
- *
26
- * const html = await renderCard({
27
- * title: 'Product',
28
- * subtitle: 'Details',
29
- * variant: 'elevated',
30
- * children: '<p>Product description...</p>',
31
- * });
32
- * ```
33
- *
34
- * @module @frontmcp/ui/react/Card
35
- */
36
- import type { ReactNode, ReactElement } from 'react';
37
- import { type CardVariant, type CardSize } from '@frontmcp/uipack/styles';
38
- /**
39
- * Card component props
40
- */
41
- export interface CardProps {
42
- /** Card title */
43
- title?: string;
44
- /** Card subtitle/description */
45
- subtitle?: string;
46
- /** Header actions (React elements) */
47
- headerActions?: ReactNode;
48
- /** Footer content (React elements) */
49
- footer?: ReactNode;
50
- /** Card variant */
51
- variant?: CardVariant;
52
- /** Card size (padding) */
53
- size?: CardSize;
54
- /** Additional CSS classes */
55
- className?: string;
56
- /** Card ID */
57
- id?: string;
58
- /** Clickable card (adds hover effects) */
59
- clickable?: boolean;
60
- /** Click handler URL */
61
- href?: string;
62
- /** Card content */
63
- children?: ReactNode;
64
- }
65
- /**
66
- * Card component.
67
- *
68
- * A versatile container component for grouping related content.
69
- * Uses Tailwind CSS classes for styling.
70
- */
71
- export declare function Card({ title, subtitle, headerActions, footer, variant, size, className, id, clickable, href, children, }: CardProps): ReactElement;
72
- /**
73
- * Props for static render functions (children is always a string)
74
- */
75
- export interface CardRenderProps extends Omit<CardProps, 'children' | 'headerActions' | 'footer'> {
76
- /** Card content as HTML string */
77
- children?: string;
78
- /** Header actions as HTML string */
79
- headerActions?: string;
80
- /** Footer content as HTML string */
81
- footer?: string;
82
- }
83
- /**
84
- * Render Card component to static HTML string (async).
85
- *
86
- * Uses React 19's prerender API for optimal static HTML generation.
87
- *
88
- * @param props - Card props (with string children)
89
- * @returns Promise resolving to HTML string
90
- */
91
- export declare function renderCard(props: CardRenderProps): Promise<string>;
92
- /**
93
- * Render Card component to static HTML string (sync).
94
- *
95
- * Uses React's renderToStaticMarkup for synchronous rendering.
96
- * Does NOT wait for Suspense boundaries.
97
- *
98
- * @param props - Card props (with string children)
99
- * @returns HTML string
100
- */
101
- export declare function renderCardSync(props: CardRenderProps): string;
102
- export default Card;
103
- //# sourceMappingURL=Card.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/react/Card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,QAAQ,EAId,MAAM,yBAAyB,CAAC;AAGjC;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,sCAAsC;IACtC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,mBAAmB;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mBAAmB;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,QAAQ,EACR,aAAa,EACb,MAAM,EACN,OAAmB,EACnB,IAAW,EACX,SAAS,EACT,EAAE,EACF,SAAS,EACT,IAAI,EACJ,QAAQ,GACT,EAAE,SAAS,GAAG,YAAY,CAqC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,eAAe,GAAG,QAAQ,CAAC;IAC/F,kCAAkC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAYxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAY7D;AAID,eAAe,IAAI,CAAC"}
@@ -1,179 +0,0 @@
1
- /**
2
- * @file context.tsx
3
- * @description React context for FrontMcpBridge.
4
- *
5
- * Provides a context provider that initializes and exposes the MCP bridge
6
- * to all child components via hooks.
7
- *
8
- * @example
9
- * ```tsx
10
- * import { McpBridgeProvider, useMcpBridge } from '@frontmcp/ui/react';
11
- *
12
- * function App() {
13
- * return (
14
- * <McpBridgeProvider>
15
- * <MyComponent />
16
- * </McpBridgeProvider>
17
- * );
18
- * }
19
- * ```
20
- *
21
- * @module @frontmcp/ui/react/hooks
22
- */
23
- import { type ReactNode } from 'react';
24
- import type { FrontMcpBridgeInterface, BridgeConfig, AdapterCapabilities, HostContext, DisplayMode } from '../../bridge';
25
- /**
26
- * MCP Bridge context value.
27
- */
28
- export interface McpBridgeContextValue {
29
- /** The bridge instance (null until initialized) */
30
- bridge: FrontMcpBridgeInterface | null;
31
- /** Whether the bridge is currently initializing */
32
- loading: boolean;
33
- /** Initialization error, if any */
34
- error: Error | null;
35
- /** Whether the bridge is initialized and ready */
36
- ready: boolean;
37
- /** Current adapter ID */
38
- adapterId: string | undefined;
39
- /** Current adapter capabilities */
40
- capabilities: AdapterCapabilities | undefined;
41
- }
42
- /**
43
- * Props for McpBridgeProvider.
44
- */
45
- export interface McpBridgeProviderProps {
46
- /** Child components */
47
- children: ReactNode;
48
- /** Bridge configuration */
49
- config?: BridgeConfig;
50
- /** Callback when bridge is ready */
51
- onReady?: (bridge: FrontMcpBridgeInterface) => void;
52
- /** Callback when bridge initialization fails */
53
- onError?: (error: Error) => void;
54
- }
55
- /**
56
- * Provider component that initializes the MCP bridge.
57
- *
58
- * @example Basic usage
59
- * ```tsx
60
- * <McpBridgeProvider>
61
- * <App />
62
- * </McpBridgeProvider>
63
- * ```
64
- *
65
- * @example With configuration
66
- * ```tsx
67
- * <McpBridgeProvider
68
- * config={{ debug: true, forceAdapter: 'generic' }}
69
- * onReady={(bridge) => console.log('Bridge ready:', bridge.adapterId)}
70
- * onError={(err) => console.error('Bridge error:', err)}
71
- * >
72
- * <App />
73
- * </McpBridgeProvider>
74
- * ```
75
- */
76
- export declare function McpBridgeProvider({ children, config, onReady, onError }: McpBridgeProviderProps): import("react/jsx-runtime").JSX.Element;
77
- /**
78
- * Hook to access the MCP bridge context.
79
- *
80
- * During client-side rendering, must be used within a McpBridgeProvider.
81
- * During SSR (outside of provider), returns a default "not ready" state.
82
- *
83
- * @example
84
- * ```tsx
85
- * function MyComponent() {
86
- * const { bridge, loading, error, ready } = useMcpBridgeContext();
87
- *
88
- * if (loading) return <div>Loading...</div>;
89
- * if (error) return <div>Error: {error.message}</div>;
90
- * if (!ready) return null;
91
- *
92
- * return <div>Adapter: {bridge.adapterId}</div>;
93
- * }
94
- * ```
95
- */
96
- export declare function useMcpBridgeContext(): McpBridgeContextValue;
97
- /**
98
- * Hook to get the MCP bridge instance.
99
- * Returns null while loading or if not initialized.
100
- *
101
- * @example
102
- * ```tsx
103
- * function MyComponent() {
104
- * const bridge = useMcpBridge();
105
- *
106
- * if (!bridge) return <div>Loading...</div>;
107
- *
108
- * const theme = bridge.getTheme();
109
- * const input = bridge.getToolInput();
110
- *
111
- * return <div>Theme: {theme}</div>;
112
- * }
113
- * ```
114
- */
115
- export declare function useMcpBridge(): FrontMcpBridgeInterface | null;
116
- /**
117
- * Hook to get the current theme from the bridge.
118
- * Automatically updates when theme changes.
119
- *
120
- * @example
121
- * ```tsx
122
- * function MyComponent() {
123
- * const theme = useTheme();
124
- * return <div className={theme === 'dark' ? 'bg-black' : 'bg-white'}>...</div>;
125
- * }
126
- * ```
127
- */
128
- export declare function useTheme(): 'light' | 'dark';
129
- /**
130
- * Hook to get the current display mode from the bridge.
131
- * Automatically updates when display mode changes.
132
- *
133
- * @example
134
- * ```tsx
135
- * function MyComponent() {
136
- * const displayMode = useDisplayMode();
137
- * return <div>Mode: {displayMode}</div>;
138
- * }
139
- * ```
140
- */
141
- export declare function useDisplayMode(): DisplayMode;
142
- /**
143
- * Hook to get the full host context from the bridge.
144
- * Automatically updates when context changes.
145
- *
146
- * @example
147
- * ```tsx
148
- * function MyComponent() {
149
- * const context = useHostContext();
150
- * return (
151
- * <div>
152
- * Theme: {context?.theme}
153
- * Locale: {context?.locale}
154
- * </div>
155
- * );
156
- * }
157
- * ```
158
- */
159
- export declare function useHostContext(): HostContext | null;
160
- /**
161
- * Hook to check if the bridge has a specific capability.
162
- *
163
- * @example
164
- * ```tsx
165
- * function MyComponent() {
166
- * const canCallTools = useCapability('canCallTools');
167
- * const canSendMessages = useCapability('canSendMessages');
168
- *
169
- * return (
170
- * <div>
171
- * {canCallTools && <button>Call Tool</button>}
172
- * {canSendMessages && <button>Send Message</button>}
173
- * </div>
174
- * );
175
- * }
176
- * ```
177
- */
178
- export declare function useCapability(cap: keyof AdapterCapabilities): boolean;
179
- //# sourceMappingURL=context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/context.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAwE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7G,OAAO,KAAK,EACV,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,WAAW,EACZ,MAAM,cAAc,CAAC;AAOtB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,mDAAmD;IACnD,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAAC;IACvC,mDAAmD;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,mCAAmC;IACnC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,kDAAkD;IAClD,KAAK,EAAE,OAAO,CAAC;IACf,yBAAyB;IACzB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,mCAAmC;IACnC,YAAY,EAAE,mBAAmB,GAAG,SAAS,CAAC;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,uBAAuB;IACvB,QAAQ,EAAE,SAAS,CAAC;IACpB,2BAA2B;IAC3B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,oCAAoC;IACpC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACpD,gDAAgD;IAChD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAQD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,sBAAsB,2CAoD/F;AAoBD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,IAAI,qBAAqB,CAS3D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,IAAI,uBAAuB,GAAG,IAAI,CAG7D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,IAAI,OAAO,GAAG,MAAM,CAqB3C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAqB5C;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,IAAI,WAAW,GAAG,IAAI,CAsBnD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,mBAAmB,GAAG,OAAO,CAGrE"}
@@ -1,42 +0,0 @@
1
- /**
2
- * @file index.ts
3
- * @description React hooks for FrontMCP bridge and tools.
4
- *
5
- * @example Provider setup
6
- * ```tsx
7
- * import { McpBridgeProvider } from '@frontmcp/ui/react';
8
- *
9
- * function App() {
10
- * return (
11
- * <McpBridgeProvider>
12
- * <MyWidget />
13
- * </McpBridgeProvider>
14
- * );
15
- * }
16
- * ```
17
- *
18
- * @example Using hooks
19
- * ```tsx
20
- * import {
21
- * useMcpBridge,
22
- * useToolInput,
23
- * useToolOutput,
24
- * useCallTool,
25
- * useTheme,
26
- * } from '@frontmcp/ui/react';
27
- *
28
- * function MyWidget() {
29
- * const bridge = useMcpBridge();
30
- * const input = useToolInput<{ location: string }>();
31
- * const theme = useTheme();
32
- * const [callTool, { data, loading }] = useCallTool('my_tool');
33
- *
34
- * return <div>...</div>;
35
- * }
36
- * ```
37
- *
38
- * @module @frontmcp/ui/react/hooks
39
- */
40
- export { McpBridgeProvider, useMcpBridgeContext, useMcpBridge, useTheme, useDisplayMode, useHostContext, useCapability, type McpBridgeContextValue, type McpBridgeProviderProps, } from './context';
41
- export { useToolInput, useToolOutput, useStructuredContent, useCallTool, useToolCalls, useSendMessage, useOpenLink, type ToolState, type UseCallToolOptions, type UseCallToolReturn, } from './tools';
42
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAGH,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,cAAc,EACd,aAAa,EACb,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,cAAc,EACd,WAAW,EACX,KAAK,SAAS,EACd,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAC"}