@frontmcp/ui 0.8.0 → 0.9.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.
package/README.md CHANGED
@@ -1,216 +1,95 @@
1
1
  # @frontmcp/ui
2
2
 
3
- FrontMCP's platform-aware UI toolkit for building HTML widgets, web components, and React surfaces that run inside MCP transports. It renders plain strings by default (perfect for agents and dual-payload responses) and exposes React renderers, web components, and bundling helpers so you can reuse the same design system everywhere.
3
+ Platform-aware UI toolkit for building HTML widgets, React components, and web components inside MCP transports.
4
4
 
5
- ## Package Split
5
+ [![NPM](https://img.shields.io/npm/v/@frontmcp/ui.svg)](https://www.npmjs.com/package/@frontmcp/ui)
6
6
 
7
- | Package | Purpose | React Required |
8
- | ------------------ | --------------------------------------------------------------- | --------------------- |
9
- | `@frontmcp/ui` | HTML components, layouts, widgets, React components/hooks | Yes (peer dependency) |
10
- | `@frontmcp/uipack` | Themes, build/render pipelines, runtime helpers, template types | No |
7
+ ## Package Split
11
8
 
12
- Use `@frontmcp/ui` for components and renderers. Pair it with `@frontmcp/uipack` for theming, build-time tooling, validation, and platform adapters.
9
+ | Package | Purpose | React Required |
10
+ | ------------------ | --------------------------------------------------------------- | -------------- |
11
+ | `@frontmcp/ui` | HTML components, React components/hooks, SSR renderers | Yes (peer dep) |
12
+ | `@frontmcp/uipack` | Themes, build/render pipelines, runtime helpers, template types | No |
13
13
 
14
- ## Installation
14
+ ## Install
15
15
 
16
16
  ```bash
17
17
  npm install @frontmcp/ui @frontmcp/uipack react react-dom
18
- # or
19
- yarn add @frontmcp/ui @frontmcp/uipack react react-dom
20
18
  ```
21
19
 
22
20
  ## Features
23
21
 
24
- - **HTML-first components** Buttons, cards, badges, alerts, forms, tables, layouts, and widgets that return ready-to-stream HTML strings.
25
- - **React + SSR** Optional React components, hooks, and renderers so you can hydrate widgets when the host allows it.
26
- - **MCP Bridge helpers** Generate bridge bundles, wrap tool responses, and expose follow-up actions from inside widgets.
27
- - **Web components** Register `<fmcp-button>`, `<fmcp-card>`, and friends for projects that prefer custom elements.
28
- - **Validation + error boxes** Every component validates its options with Zod and renders a friendly error when something is misconfigured.
29
- - **Works with uipack** Import themes, runtime helpers, adapters, and build APIs from `@frontmcp/uipack` to keep HTML and React outputs in sync.
30
-
31
- ## Quick Start
22
+ - **HTML-first components** buttons, cards, badges, alerts, forms, tables, layouts that return ready-to-stream HTML ([docs][docs-components])
23
+ - **React components** `Button`, `Card`, `Alert`, `Badge` with TypeScript props ([docs][docs-react])
24
+ - **MCP Bridge hooks** `useMcpBridge`, `useCallTool`, `useToolInput`, `useToolOutput` ([docs][docs-hooks])
25
+ - **SSR + hydration** `ReactRenderer` for server-side rendering, `ReactRendererAdapter` for client hydration ([docs][docs-ssr])
26
+ - **MDX rendering** server-side MDX-to-HTML with component resolution ([docs][docs-mdx])
27
+ - **Web components** `<fmcp-button>`, `<fmcp-card>`, and friends as custom elements ([docs][docs-web-components])
28
+ - **Universal app shell** — `FrontMCPProvider` + `UniversalApp` for platform-agnostic React apps ([docs][docs-universal])
29
+ - **SSR bundling** — `InMemoryBundler` for component compilation ([docs][docs-bundling])
32
30
 
33
- ### HTML components
31
+ ## Quick Example
34
32
 
35
33
  ```ts
36
34
  import { card, button } from '@frontmcp/ui/components';
37
35
  import { baseLayout } from '@frontmcp/ui/layouts';
38
36
  import { DEFAULT_THEME } from '@frontmcp/uipack/theme';
39
37
 
40
- const widget = card(
41
- `
42
- <h2 class="text-lg font-semibold">CRM Access</h2>
43
- <p>Grant the orchestrator access to customer data.</p>
44
- ${button('Approve', { variant: 'primary', type: 'submit' })}
45
- `,
46
- { variant: 'elevated' },
47
- );
48
-
49
- const html = baseLayout(widget, {
50
- title: 'Authorize CRM',
51
- description: 'Let the agent read CRM data for this session.',
38
+ const html = baseLayout(card(`<h2>Hello</h2>${button('Submit', { variant: 'primary' })}`, { variant: 'elevated' }), {
39
+ title: 'My Widget',
52
40
  theme: DEFAULT_THEME,
53
- width: 'md',
54
- align: 'center',
55
- scripts: { tailwind: true, htmx: true },
56
- });
57
- ```
58
-
59
- ### React components
60
-
61
- ```tsx
62
- import { Button, Card, Alert, Badge } from '@frontmcp/ui/react';
63
-
64
- function MyWidget() {
65
- return (
66
- <Card title="Welcome">
67
- <Alert variant="info">Hello, world!</Alert>
68
- <Button variant="primary" onClick={handleClick}>
69
- Get Started
70
- </Button>
71
- <Badge variant="success">Active</Badge>
72
- </Card>
73
- );
74
- }
75
- ```
76
-
77
- ### MCP Bridge hooks
78
-
79
- ```tsx
80
- import { useMcpBridge, useCallTool, useToolInput, useToolOutput } from '@frontmcp/ui/react/hooks';
81
-
82
- function ToolWidget() {
83
- const bridge = useMcpBridge();
84
- const { call, loading, error } = useCallTool();
85
- const input = useToolInput();
86
- const output = useToolOutput();
87
-
88
- const handleClick = async () => {
89
- await call('my-tool', { data: input.query });
90
- };
91
-
92
- return (
93
- <div>
94
- <p>Query: {input.query}</p>
95
- {loading && <p>Loading...</p>}
96
- {error && <p>Error: {error.message}</p>}
97
- {output && <pre>{JSON.stringify(output, null, 2)}</pre>}
98
- <button onClick={handleClick}>Run Tool</button>
99
- </div>
100
- );
101
- }
102
- ```
103
-
104
- ### Universal app shell
105
-
106
- ```tsx
107
- import { UniversalApp, FrontMCPProvider } from '@frontmcp/ui/universal';
108
-
109
- function App() {
110
- return (
111
- <FrontMCPProvider>
112
- <UniversalApp>
113
- <ToolWidget />
114
- </UniversalApp>
115
- </FrontMCPProvider>
116
- );
117
- }
118
- ```
119
-
120
- ## Entry points
121
-
122
- | Path | Exports |
123
- | ----------------------------- | -------------------------------------------------- |
124
- | `@frontmcp/ui/components` | HTML components, helpers, error boxes |
125
- | `@frontmcp/ui/layouts` | Base layouts, consent/error templates |
126
- | `@frontmcp/ui/pages` | High-level page templates |
127
- | `@frontmcp/ui/widgets` | OpenAI App SDK-style widgets |
128
- | `@frontmcp/ui/react` | React components |
129
- | `@frontmcp/ui/react/hooks` | MCP Bridge React hooks |
130
- | `@frontmcp/ui/renderers` | ReactRenderer + adapter helpers |
131
- | `@frontmcp/ui/render` | React 19 static rendering utilities |
132
- | `@frontmcp/ui/web-components` | `<fmcp-*>` custom elements |
133
- | `@frontmcp/ui/bridge` | Bridge registry + adapters |
134
- | `@frontmcp/ui/bundler` | SSR/component bundler (uses uipack under the hood) |
135
-
136
- Use `@frontmcp/uipack/theme`, `@frontmcp/uipack/runtime`, and `@frontmcp/uipack/build` for theming, runtime helpers, and build-time APIs.
137
-
138
- ## Server-side rendering
139
-
140
- ### ReactRenderer (SSR)
141
-
142
- ```ts
143
- import { ReactRenderer, reactRenderer } from '@frontmcp/ui/renderers';
144
-
145
- const html = await reactRenderer.render(MyComponent, {
146
- input: { query: 'test' },
147
- output: { result: 'data' },
148
41
  });
149
42
  ```
150
43
 
151
- ### ReactRendererAdapter (client hydration)
44
+ > Full guide: [UI Overview][docs-overview]
45
+
46
+ ## Entry Points
47
+
48
+ | Path | Exports |
49
+ | ----------------------------- | ------------------------------------- |
50
+ | `@frontmcp/ui/components` | HTML components, helpers, error boxes |
51
+ | `@frontmcp/ui/layouts` | Base layouts, consent/error templates |
52
+ | `@frontmcp/ui/pages` | High-level page templates |
53
+ | `@frontmcp/ui/widgets` | OpenAI App SDK-style widgets |
54
+ | `@frontmcp/ui/react` | React components + hooks |
55
+ | `@frontmcp/ui/renderers` | ReactRenderer, MdxRenderer, adapters |
56
+ | `@frontmcp/ui/render` | React 19 static rendering utilities |
57
+ | `@frontmcp/ui/web-components` | `<fmcp-*>` custom elements |
58
+ | `@frontmcp/ui/bridge` | Bridge registry + adapters |
59
+ | `@frontmcp/ui/bundler` | SSR/component bundler |
60
+
61
+ ## Docs
62
+
63
+ | Topic | Link |
64
+ | ---------------- | ------------------------------------- |
65
+ | Overview | [UI Overview][docs-overview] |
66
+ | HTML components | [Components][docs-components] |
67
+ | React components | [React][docs-react] |
68
+ | MCP Bridge hooks | [Hooks][docs-hooks] |
69
+ | SSR rendering | [SSR][docs-ssr] |
70
+ | MDX rendering | [MDX][docs-mdx] |
71
+ | Web components | [Web Components][docs-web-components] |
72
+ | Universal app | [Universal App][docs-universal] |
73
+ | Bundling | [Bundling][docs-bundling] |
74
+
75
+ ## Related Packages
76
+
77
+ - [`@frontmcp/uipack`](../uipack) — React-free themes, runtime helpers, build tooling
78
+ - [`@frontmcp/sdk`](../sdk) — core framework
79
+ - [`@frontmcp/testing`](../testing) — UI assertions (`toHaveRenderedHtml`, `toBeXssSafe`)
152
80
 
153
- ```ts
154
- import { ReactRendererAdapter, createReactAdapter } from '@frontmcp/ui/renderers';
155
-
156
- const adapter = createReactAdapter();
157
- await adapter.hydrate(targetElement, context);
158
- await adapter.renderToDOM(content, targetElement, context);
159
- adapter.destroy(targetElement);
160
- ```
161
-
162
- ## SSR bundling
163
-
164
- ```ts
165
- import { InMemoryBundler, createBundler } from '@frontmcp/ui/bundler';
166
-
167
- const bundler = createBundler({ cache: true });
168
- const result = await bundler.bundle('./components/MyWidget.tsx');
169
- ```
170
-
171
- ## Using with @frontmcp/uipack
172
-
173
- ```ts
174
- // Theme + scripts
175
- import { DEFAULT_THEME, createTheme } from '@frontmcp/uipack/theme';
176
-
177
- // Build API & adapters
178
- import { buildToolUI, buildToolDiscoveryMeta } from '@frontmcp/uipack/build';
179
-
180
- // Runtime helpers
181
- import { wrapToolUI, createTemplateHelpers } from '@frontmcp/uipack/runtime';
182
-
183
- // Validation + utils
184
- import { validateOptions } from '@frontmcp/uipack/validation';
185
- ```
186
-
187
- `@frontmcp/uipack` lets you configure themes, register cached widgets, wrap templates with CSP, and emit platform-specific metadata without pulling React into HTML-only projects.
188
-
189
- ## Peer dependencies
190
-
191
- ```json
192
- {
193
- "peerDependencies": {
194
- "react": "^18.0.0 || ^19.0.0",
195
- "react-dom": "^18.0.0 || ^19.0.0",
196
- "@frontmcp/uipack": "^0.6.1"
197
- }
198
- }
199
- ```
200
-
201
- ## Development
202
-
203
- ```bash
204
- yarn nx build ui
205
- yarn nx test ui
206
- ```
207
-
208
- ## Related packages
81
+ ## License
209
82
 
210
- - [`@frontmcp/uipack`](../uipack/README.md) – React-free themes, runtime helpers, build tooling
211
- - [`@frontmcp/sdk`](../sdk/README.md) – Core SDK
212
- - [`@frontmcp/testing`](../testing/README.md) – UI assertions and fixtures
83
+ Apache-2.0 — see [LICENSE](../../LICENSE).
213
84
 
214
- ## License
85
+ <!-- links -->
215
86
 
216
- Apache-2.0
87
+ [docs-overview]: https://docs.agentfront.dev/frontmcp/ui/overview
88
+ [docs-components]: https://docs.agentfront.dev/frontmcp/ui/components
89
+ [docs-react]: https://docs.agentfront.dev/frontmcp/ui/react
90
+ [docs-hooks]: https://docs.agentfront.dev/frontmcp/ui/hooks
91
+ [docs-ssr]: https://docs.agentfront.dev/frontmcp/ui/ssr
92
+ [docs-mdx]: https://docs.agentfront.dev/frontmcp/ui/mdx
93
+ [docs-web-components]: https://docs.agentfront.dev/frontmcp/ui/web-components
94
+ [docs-universal]: https://docs.agentfront.dev/frontmcp/ui/universal
95
+ [docs-bundling]: https://docs.agentfront.dev/frontmcp/ui/bundling
@@ -1 +1 @@
1
- {"version":3,"file":"claude.adapter.d.ts","sourceRoot":"","sources":["../../../src/bridge/adapters/claude.adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAwB,MAAM,gBAAgB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C,QAAQ,CAAC,EAAE,YAAY;IACvB,QAAQ,CAAC,IAAI,wBAAwB;IACrC,QAAQ,CAAC,QAAQ,MAAM;;IAgBvB;;;;;OAKG;IACH,SAAS,IAAI,OAAO;IAgCpB;;OAEG;IACY,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAU1C;;;OAGG;IACY,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMnD;;OAEG;IACY,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpE;;OAEG;IACY,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAS5C;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAoB5B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD"}
1
+ {"version":3,"file":"claude.adapter.d.ts","sourceRoot":"","sources":["../../../src/bridge/adapters/claude.adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAwB,MAAM,gBAAgB,CAAC;AAkBnE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C,QAAQ,CAAC,EAAE,YAAY;IACvB,QAAQ,CAAC,IAAI,wBAAwB;IACrC,QAAQ,CAAC,QAAQ,MAAM;;IAgBvB;;;;;OAKG;IACH,SAAS,IAAI,OAAO;IAgCpB;;OAEG;IACY,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAU1C;;;OAGG;IACY,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMnD;;OAEG;IACY,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpE;;OAEG;IACY,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAS5C;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAoB5B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"gemini.adapter.d.ts","sourceRoot":"","sources":["../../../src/bridge/adapters/gemini.adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAwB,MAAM,gBAAgB,CAAC;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AG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAanD;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAqB5B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD"}
package/bridge/index.js CHANGED
@@ -1507,6 +1507,13 @@ var ExtAppsNotSupportedError = class extends Error {
1507
1507
  };
1508
1508
 
1509
1509
  // libs/ui/src/bridge/adapters/claude.adapter.ts
1510
+ var CLAUDE_DOMAINS = ["claude.ai", "anthropic.com"];
1511
+ function isValidClaudeDomain(hostname) {
1512
+ const lowerHost = hostname.toLowerCase();
1513
+ return CLAUDE_DOMAINS.some(
1514
+ (domain) => lowerHost === domain || lowerHost.endsWith("." + domain)
1515
+ );
1516
+ }
1510
1517
  var ClaudeAdapter = class extends BaseAdapter {
1511
1518
  id = "claude";
1512
1519
  name = "Claude (Anthropic)";
@@ -1547,8 +1554,7 @@ var ClaudeAdapter = class extends BaseAdapter {
1547
1554
  if (win.claude) return true;
1548
1555
  if (win.__claudeArtifact) return true;
1549
1556
  if (typeof location !== "undefined") {
1550
- const href = location.href;
1551
- if (href.includes("claude.ai") || href.includes("anthropic.com")) {
1557
+ if (isValidClaudeDomain(location.hostname)) {
1552
1558
  return true;
1553
1559
  }
1554
1560
  }
@@ -1608,6 +1614,13 @@ function createClaudeAdapter() {
1608
1614
  }
1609
1615
 
1610
1616
  // libs/ui/src/bridge/adapters/gemini.adapter.ts
1617
+ var GEMINI_DOMAINS = ["gemini.google.com", "bard.google.com"];
1618
+ function isValidGeminiDomain(hostname) {
1619
+ const lowerHost = hostname.toLowerCase();
1620
+ return GEMINI_DOMAINS.some(
1621
+ (domain) => lowerHost === domain || lowerHost.endsWith("." + domain)
1622
+ );
1623
+ }
1611
1624
  var GeminiAdapter = class extends BaseAdapter {
1612
1625
  id = "gemini";
1613
1626
  name = "Google Gemini";
@@ -1637,8 +1650,7 @@ var GeminiAdapter = class extends BaseAdapter {
1637
1650
  if (win.__mcpPlatform === "gemini") return true;
1638
1651
  if (win.gemini) return true;
1639
1652
  if (typeof location !== "undefined") {
1640
- const href = location.href;
1641
- if (href.includes("gemini.google.com") || href.includes("bard.google.com")) {
1653
+ if (isValidGeminiDomain(location.hostname)) {
1642
1654
  return true;
1643
1655
  }
1644
1656
  }
@@ -8,7 +8,12 @@
8
8
  */
9
9
  export type AlertVariant = 'info' | 'success' | 'warning' | 'danger' | 'neutral';
10
10
  /**
11
- * Alert component options
11
+ * Alert component options.
12
+ *
13
+ * **Security Note**: The `icon` and `actions` parameters accept raw HTML.
14
+ * Do NOT pass untrusted user input to these parameters without sanitization.
15
+ * Use `escapeHtml()` from `@frontmcp/ui/layouts` for text content, or use the
16
+ * `sanitize` option to automatically sanitize HTML content.
12
17
  */
13
18
  export interface AlertOptions {
14
19
  /** Alert variant */
@@ -17,7 +22,10 @@ export interface AlertOptions {
17
22
  title?: string;
18
23
  /** Show icon */
19
24
  showIcon?: boolean;
20
- /** Custom icon (overrides default) */
25
+ /**
26
+ * Custom icon (overrides default, raw HTML).
27
+ * **Warning**: Do not pass untrusted user input without sanitization.
28
+ */
21
29
  icon?: string;
22
30
  /** Dismissible alert */
23
31
  dismissible?: boolean;
@@ -25,8 +33,17 @@ export interface AlertOptions {
25
33
  className?: string;
26
34
  /** Alert ID */
27
35
  id?: string;
28
- /** Actions (buttons) */
36
+ /**
37
+ * Actions (buttons, raw HTML).
38
+ * **Warning**: Do not pass untrusted user input without sanitization.
39
+ */
29
40
  actions?: string;
41
+ /**
42
+ * If true, sanitizes HTML content to prevent XSS.
43
+ * Removes script tags, event handlers, and dangerous attributes.
44
+ * @default false
45
+ */
46
+ sanitize?: boolean;
30
47
  }
31
48
  /**
32
49
  * Build an alert component
@@ -1 +1 @@
1
- {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/components/alert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SA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AS,MAAM,EAAE,OAAO,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,WACjC,CAAC;AAE/C,8BAA8B;AAC9B,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,EAAE,OAAO,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,WACjC,CAAC;AAElD,8BAA8B;AAC9B,eAAO,MAAM,YAAY,GAAI,SAAS,MAAM,EAAE,OAAO,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,WACjC,CAAC;AAElD,mCAAmC;AACnC,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,EAAE,OAAO,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,WACjC,CAAC;AAMjD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oBAAoB;IACpB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe;IACf,QAAQ,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,cAAc,GAAG,aAAa,GAAG,YAAY,GAAG,eAAe,CAAC;IACtG,eAAe;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,GAAG,MAAM,CAyDzE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,GAAE,YAAY,CAAC,UAAU,CAAe,EAAE,EAAE,SAAoB,GAAG,MAAM,CAW/G"}
@@ -12,7 +12,12 @@ export type BadgeVariant = 'default' | 'primary' | 'secondary' | 'success' | 'wa
12
12
  */
13
13
  export type BadgeSize = 'sm' | 'md' | 'lg';
14
14
  /**
15
- * Badge component options
15
+ * Badge component options.
16
+ *
17
+ * **Security Note**: The `icon` parameter accepts raw HTML.
18
+ * Do NOT pass untrusted user input to this parameter without sanitization.
19
+ * Use `escapeHtml()` from `@frontmcp/ui/layouts` for text content, or use the
20
+ * `sanitize` option to automatically sanitize HTML content.
16
21
  */
17
22
  export interface BadgeOptions {
18
23
  /** Badge variant */
@@ -21,7 +26,10 @@ export interface BadgeOptions {
21
26
  size?: BadgeSize;
22
27
  /** Rounded pill style */
23
28
  pill?: boolean;
24
- /** Icon before text */
29
+ /**
30
+ * Icon before text (raw HTML).
31
+ * **Warning**: Do not pass untrusted user input without sanitization.
32
+ */
25
33
  icon?: string;
26
34
  /** Dot indicator (no text) */
27
35
  dot?: boolean;
@@ -29,6 +37,12 @@ export interface BadgeOptions {
29
37
  className?: string;
30
38
  /** Removable badge */
31
39
  removable?: boolean;
40
+ /**
41
+ * If true, sanitizes HTML content to prevent XSS.
42
+ * Removes script tags, event handlers, and dangerous attributes.
43
+ * @default false
44
+ */
45
+ sanitize?: boolean;
32
46
  }
33
47
  /**
34
48
  * Build a badge component
@@ -1 +1 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/components/badge.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oBAAoB;IACpB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,iBAAiB;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,yBAAyB;IACzB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBA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C;AAM1G,wBAAwB;AACxB,eAAO,MAAM,SAAS,GAAI,cAAgB,WAAoD,CAAC;AAE/F,yBAAyB;AACzB,eAAO,MAAM,UAAU,GAAI,cAAiB,WAAoD,CAAC;AAEjG,sBAAsB;AACtB,eAAO,MAAM,OAAO,GAAI,cAAc,WAAmD,CAAC;AAE1F,sBAAsB;AACtB,eAAO,MAAM,OAAO,GAAI,cAAc,WAAoD,CAAC"}
@@ -12,20 +12,31 @@ export type CardVariant = 'default' | 'outlined' | 'elevated' | 'filled' | 'ghos
12
12
  */
13
13
  export type CardSize = 'sm' | 'md' | 'lg';
14
14
  /**
15
- * Card component options
15
+ * Card component options.
16
+ *
17
+ * **Security Note**: The `headerActions`, `footer`, and `content` parameters accept raw HTML.
18
+ * Do NOT pass untrusted user input to these parameters without sanitization.
19
+ * Use `escapeHtml()` from `@frontmcp/ui/layouts` for text content, or use the
20
+ * `sanitize` option to automatically sanitize HTML content.
16
21
  */
17
22
  export interface CardOptions {
18
23
  /** Card variant */
19
24
  variant?: CardVariant;
20
25
  /** Card size (padding) */
21
26
  size?: CardSize;
22
- /** Card title */
27
+ /** Card title (will be HTML-escaped) */
23
28
  title?: string;
24
- /** Card subtitle/description */
29
+ /** Card subtitle/description (will be HTML-escaped) */
25
30
  subtitle?: string;
26
- /** Header actions (HTML) */
31
+ /**
32
+ * Header actions (raw HTML).
33
+ * **Warning**: Do not pass untrusted user input without sanitization.
34
+ */
27
35
  headerActions?: string;
28
- /** Footer content (HTML) */
36
+ /**
37
+ * Footer content (raw HTML).
38
+ * **Warning**: Do not pass untrusted user input without sanitization.
39
+ */
29
40
  footer?: string;
30
41
  /** Additional CSS classes */
31
42
  className?: string;
@@ -37,9 +48,21 @@ export interface CardOptions {
37
48
  clickable?: boolean;
38
49
  /** Click handler URL */
39
50
  href?: string;
51
+ /**
52
+ * If true, sanitizes HTML content to prevent XSS.
53
+ * Removes script tags, event handlers, and dangerous attributes.
54
+ * @default false
55
+ */
56
+ sanitize?: boolean;
40
57
  }
41
58
  /**
42
- * Build a card component
59
+ * Build a card component.
60
+ *
61
+ * @param content - Card body content (raw HTML).
62
+ * **Warning**: Do not pass untrusted user input without sanitization.
63
+ * Use the `sanitize: true` option to automatically sanitize content.
64
+ * @param options - Card options
65
+ * @returns HTML string for the card
43
66
  */
44
67
  export declare function card(content: string, options?: CardOptions): string;
45
68
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEnF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,mBAAmB;IACnB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4BAA4B;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,sBAAsB;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA0CD;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,G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;GAQG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,MAAM,CA6DvE;AAED;;GAEG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,EAAE,EACf,OAAO,GAAE;IACP,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACtC,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACf,GACL,MAAM,CAWR"}
@@ -16,7 +16,11 @@ export type InputSize = 'sm' | 'md' | 'lg';
16
16
  */
17
17
  export type InputState = 'default' | 'error' | 'success' | 'warning';
18
18
  /**
19
- * Base input options
19
+ * Base input options.
20
+ *
21
+ * **Security Note**: The `iconBefore` and `iconAfter` parameters accept raw HTML.
22
+ * Do NOT pass untrusted user input without sanitization.
23
+ * Use the `sanitize` option to automatically sanitize icon content.
20
24
  */
21
25
  export interface InputOptions {
22
26
  /** Input type */
@@ -29,11 +33,11 @@ export interface InputOptions {
29
33
  value?: string;
30
34
  /** Placeholder text */
31
35
  placeholder?: string;
32
- /** Label text */
36
+ /** Label text (will be HTML-escaped) */
33
37
  label?: string;
34
- /** Helper text */
38
+ /** Helper text (will be HTML-escaped) */
35
39
  helper?: string;
36
- /** Error message */
40
+ /** Error message (will be HTML-escaped) */
37
41
  error?: string;
38
42
  /** Input size */
39
43
  size?: InputSize;
@@ -59,10 +63,21 @@ export interface InputOptions {
59
63
  className?: string;
60
64
  /** Data attributes */
61
65
  data?: Record<string, string>;
62
- /** Icon before input */
66
+ /**
67
+ * Icon before input (raw HTML, e.g., SVG).
68
+ * **Warning**: Do not pass untrusted user input without sanitization.
69
+ */
63
70
  iconBefore?: string;
64
- /** Icon after input */
71
+ /**
72
+ * Icon after input (raw HTML, e.g., SVG).
73
+ * **Warning**: Do not pass untrusted user input without sanitization.
74
+ */
65
75
  iconAfter?: string;
76
+ /**
77
+ * If true, sanitizes icon HTML content to prevent XSS.
78
+ * @default false
79
+ */
80
+ sanitize?: boolean;
66
81
  }
67
82
  /**
68
83
  * Select options
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/components/form.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAQH;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,OAAO,GACP,UAAU,GACV,QAAQ,GACR,KAAK,GACL,KAAK,GACL,QAAQ,GACR,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,QAAQ,CAAC;AAEb;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAMrE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,iBAAiB;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,iBAAiB;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,kBAAkB;IAClB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B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