Skip to content

Commit 56d8415

Browse files
committed
fix(docs): add missing mcp apps and custom elements manifest docs
Signed-off-by: Cory Rylan <crylan@nvidia.com>
1 parent 27f7bd1 commit 56d8415

6 files changed

Lines changed: 346 additions & 1 deletion

File tree

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
import { html } from 'lit';
5+
import '@nvidia-elements/core/button/define.js';
6+
import '@nvidia-elements/core/chat-message/define.js';
7+
import '@nvidia-elements/core/dialog/define.js';
8+
import '@nvidia-elements/core/icon-button/define.js';
9+
import '@nvidia-elements/core/logo/define.js';
10+
import '@nvidia-elements/core/page/define.js';
11+
import '@nvidia-elements/core/page-header/define.js';
12+
import '@nvidia-elements/core/textarea/define.js';
13+
14+
export default {
15+
title: 'Patterns/Chat',
16+
component: 'nve-patterns'
17+
};
18+
19+
/**
20+
* @summary Centered page chat with a constrained message column and footer composer. Use for primary assistant experiences where the conversation is the main task and needs persistent input.
21+
* @tags pattern
22+
*/
23+
export const PageChat = {
24+
render: () => html`
25+
<nve-page>
26+
<nve-page-header slot="header">
27+
<nve-logo slot="prefix" size="sm" color="brand-green">AI</nve-logo>
28+
<h1 slot="prefix" nve-text="heading sm">Assistant</h1>
29+
</nve-page-header>
30+
<nve-page-panel slot="subheader">
31+
<nve-page-panel-content>
32+
<h2 nve-text="heading sm">Deployment risk review</h2>
33+
</nve-page-panel-content>
34+
</nve-page-panel>
35+
<main nve-layout="column pad:lg align:horizontal-center">
36+
<section nve-layout="column gap:lg align:horizontal-stretch" aria-live="polite" aria-relevant="additions text" style="max-width: 520px; margin: 0 auto;">
37+
<nve-chat-message aria-label="user message" arrow-position="top-end" style="margin-inline-start: auto; max-width: 80%;">
38+
<nve-avatar slot="suffix" color="brand-green">NV</nve-avatar>
39+
Summarize the deployment risk for the new inference endpoint.
40+
</nve-chat-message>
41+
<nve-chat-message aria-label="assistant message" arrow-position="top-start" style="max-width: 80%;">
42+
<nve-avatar slot="prefix" color="gray-denim">AI</nve-avatar>
43+
The highest risk is the cold-start latency on the first request after scale-out. Keep the rollout limited to the staging pool until p95 startup time stays below the service target for three consecutive runs.
44+
</nve-chat-message>
45+
<nve-chat-message aria-label="user message" arrow-position="top-end" style="margin-inline-start: auto; max-width: 80%;">
46+
<nve-avatar slot="suffix" color="brand-green">NV</nve-avatar>
47+
What should the operator check first?
48+
</nve-chat-message>
49+
</section>
50+
</main>
51+
<form slot="footer" nve-layout="column gap:sm full pad:md" style="max-width: 520px; margin: 0 auto;">
52+
<nve-textarea>
53+
<textarea aria-label="Message Agent" name="message" rows="3" maxlength="4000" placeholder="Ask about this deployment"></textarea>
54+
</nve-textarea>
55+
<nve-button type="button" style="margin-inline-start: auto;">Send</nve-button>
56+
</form>
57+
</nve-page>
58+
`
59+
};
60+
61+
/**
62+
* @summary Right-side chat panel with persistent header, scrollable transcript, and footer composer. Use when chat supports a larger workspace without taking over the main content.
63+
* @tags pattern
64+
*/
65+
export const PanelChat = {
66+
render: () => html`
67+
<nve-page>
68+
<nve-page-header slot="header">
69+
<nve-logo slot="prefix" size="sm" color="brand-green">AI</nve-logo>
70+
<h1 slot="prefix" nve-text="heading sm">Prompt API Chat</h1>
71+
</nve-page-header>
72+
<main nve-layout="column gap:lg pad:lg align:horizontal-stretch">
73+
<section nve-layout="column gap:md" style="max-width: 900px;">
74+
<h2 nve-text="heading">Model deployment</h2>
75+
<p nve-text="body">
76+
Keep the assistant available while operators inspect logs, metrics, and deployment details in the main workspace.
77+
</p>
78+
</section>
79+
</main>
80+
<nve-page-panel id="chat-panel" slot="right" aria-labelledby="chat-title">
81+
<nve-page-panel-header>
82+
<h2 id="chat-title" nve-text="heading sm">Assistant</h2>
83+
</nve-page-panel-header>
84+
<nve-page-panel-content>
85+
<section nve-layout="column gap:lg align:horizontal-stretch" aria-live="polite" aria-relevant="additions text" style="margin-inline-start: auto;">
86+
<nve-chat-message aria-label="user message" arrow-position="top-end" color="brand-green" style="margin-inline-start: auto;">
87+
How does the nve-badge work?
88+
</nve-chat-message>
89+
<nve-chat-message aria-label="assistant message" arrow-position="top-start">
90+
The badge communicates short status, count, or label information next to related content. Use status values when the badge describes system state and color values when it needs to match a broader visual category.
91+
</nve-chat-message>
92+
</section>
93+
</nve-page-panel-content>
94+
<nve-page-panel-footer>
95+
<form nve-layout="column gap:sm full">
96+
<nve-textarea>
97+
<textarea aria-label="Message Agent" name="message" rows="3" maxlength="4000" placeholder="Ask about NVIDIA Elements"></textarea>
98+
</nve-textarea>
99+
<nve-button type="button" style="margin-inline-start: auto;">Send</nve-button>
100+
</form>
101+
</nve-page-panel-footer>
102+
</nve-page-panel>
103+
</nve-page>
104+
`
105+
};
106+
107+
/**
108+
* @summary Bottom-right anchored chat dialog with launcher button. Use for optional contextual help or assistant support that should stay available without changing the page layout.
109+
* @tags pattern
110+
*/
111+
export const PopoverChat = {
112+
render: () => html`
113+
<nve-icon-button
114+
id="chat-launcher"
115+
popovertarget="chat-popover"
116+
interaction="emphasis"
117+
icon-name="chat-bubble"
118+
size="lg"
119+
aria-label="Open assistant"
120+
style="position: fixed; inset-block-end: var(--nve-ref-space-xl); inset-inline-end: var(--nve-ref-space-xl); z-index: 100;"
121+
></nve-icon-button>
122+
<nve-dialog
123+
id="chat-popover"
124+
anchor="chat-launcher"
125+
position="top"
126+
alignment="end"
127+
size="sm"
128+
closable
129+
style="--max-width: 320px; --min-height: 340px; margin: var(--nve-ref-space-sm)"
130+
>
131+
<nve-dialog-header>
132+
<h2 nve-text="heading sm">Assistant</h2>
133+
</nve-dialog-header>
134+
<section nve-layout="column gap:md full" aria-live="polite" aria-relevant="additions text">
135+
<nve-chat-message aria-label="assistant message" arrow-position="top-start">
136+
I can help compare alerts, explain metrics, or draft a remediation checklist.
137+
</nve-chat-message>
138+
<nve-chat-message aria-label="user message" arrow-position="top-end" color="brand-green" style="margin-inline-start: auto;">
139+
Why did the deployment pause?
140+
</nve-chat-message>
141+
<nve-chat-message aria-label="assistant message" arrow-position="top-start">
142+
The canary paused because error rate exceeded the threshold for two consecutive windows.
143+
</nve-chat-message>
144+
</section>
145+
<nve-dialog-footer>
146+
<form nve-layout="column gap:sm full">
147+
<nve-textarea>
148+
<textarea aria-label="Message Agent" name="message" rows="2" maxlength="4000" placeholder="Ask for help"></textarea>
149+
</nve-textarea>
150+
<nve-button type="button" style="margin-inline-start: auto;">Send</nve-button>
151+
</form>
152+
</nve-dialog-footer>
153+
</nve-dialog>
154+
<script type="module">
155+
await customElements.whenDefined('nve-dialog');
156+
const dialog = document.querySelector('#chat-popover');
157+
const launcher = document.querySelector('#chat-launcher');
158+
if (dialog && launcher && !dialog.matches(':popover-open')) {
159+
dialog.showPopover({ source: launcher });
160+
}
161+
</script>
162+
`
163+
};

projects/site/src/_11ty/layouts/common.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export const renderDocsNav = data => /* html */ `
136136
<nve-tree-node ${data.page.url.includes('/docs/lint/') ? 'highlighted selected' : ''}><a href="docs/lint/">Lint</a></nve-tree-node>
137137
<nve-tree-node ${data.page.url.includes('/docs/integrations/angular/') ? 'highlighted selected' : ''}><a href="docs/integrations/angular/">Angular</a></nve-tree-node>
138138
<nve-tree-node ${data.page.url.includes('/docs/integrations/bundles/') ? 'highlighted selected' : ''}><a href="docs/integrations/bundles/">Bundles</a></nve-tree-node>
139+
<nve-tree-node ${data.page.url.includes('/docs/integrations/custom-elements/') ? 'highlighted selected' : ''}><a href="docs/integrations/custom-elements/">Custom Elements</a></nve-tree-node>
139140
<nve-tree-node ${data.page.url.includes('/docs/integrations/extensions/') ? 'highlighted selected' : ''}><a href="docs/integrations/extensions/">Extensions</a></nve-tree-node>
140141
<nve-tree-node ${data.page.url.includes('/docs/integrations/go/') ? 'highlighted selected' : ''}><a href="docs/integrations/go/">Golang</a></nve-tree-node>
141142
<nve-tree-node ${data.page.url.includes('/docs/integrations/hugo/') ? 'highlighted selected' : ''}><a href="docs/integrations/hugo/">Hugo</a></nve-tree-node>
@@ -287,6 +288,7 @@ export const renderDocsNav = data => /* html */ `
287288
<a href="docs/patterns/">Patterns</a>
288289
<nve-tree-node ${data.page.url.includes('/docs/patterns/authentication/') ? 'highlighted selected' : ''}><a href="docs/patterns/authentication/">Authentication</a></nve-tree-node>
289290
<nve-tree-node ${data.page.url.includes('/docs/patterns/browse/') ? 'highlighted selected' : ''}><a href="docs/patterns/browse/">Browse</a></nve-tree-node>
291+
<nve-tree-node ${data.page.url.includes('/docs/patterns/chat/') ? 'highlighted selected' : ''}><a href="docs/patterns/chat/">Chat</a></nve-tree-node>
290292
<nve-tree-node ${data.page.url.includes('/docs/patterns/dashboard/') ? 'highlighted selected' : ''}><a href="docs/patterns/dashboard/">Dashboard</a></nve-tree-node>
291293
<nve-tree-node ${data.page.url.includes('/docs/patterns/editor/') ? 'highlighted selected' : ''}><a href="docs/patterns/editor/">Editor</a></nve-tree-node>
292294
<nve-tree-node ${data.page.url.includes('/docs/patterns/empty-states/') ? 'highlighted selected' : ''}><a href="docs/patterns/empty-states/">Empty States</a></nve-tree-node>
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
{
3+
title: 'Custom Elements Manifest',
4+
description: 'Use the Custom Elements Manifest files published with NVIDIA Elements packages for editor integrations, generated types, documentation, validation, and AI tooling.',
5+
layout: 'docs.11ty.js'
6+
}
7+
---
8+
9+
# {{ title }}
10+
11+
<h2 nve-text="heading sm muted">Elements packages publish machine-readable component API metadata for tools that understand Web Components</h2>
12+
13+
A [Custom Elements Manifest](https://github.com/webcomponents/custom-elements-manifest) is a JSON file that describes a package's custom elements. The standard exists so editors, documentation viewers, linters, framework adapters, catalogs, and test tooling can read one package-level API description instead of scraping source code.
14+
15+
Elements packages that publish a manifest declare it in `package.json`:
16+
17+
```json
18+
{
19+
"customElements": "dist/custom-elements.json"
20+
}
21+
```
22+
23+
That field is the discovery hook. Tools can inspect `package.json`, find the `customElements` path, and load the package's `dist/custom-elements.json` file from `node_modules`.
24+
25+
## What Is In The Manifest
26+
27+
The manifest describes the public Web Component surface. For Elements components, that includes:
28+
29+
- Tag names such as `nve-button`
30+
- JavaScript module paths and custom element definition exports
31+
- Public properties and reflected attributes
32+
- Events
33+
- Slots
34+
- CSS custom properties
35+
- Component descriptions, examples, status metadata, and package metadata
36+
37+
The manifest does not register components. Continue to use explicit registration imports such as `@nvidia-elements/core/button/define.js` when application code needs the component at runtime.
38+
39+
## Published Package Files
40+
41+
Most published `@nvidia-elements/*` packages include `customElements` metadata. Component packages commonly expose a small set of generated integration files beside the manifest:
42+
43+
<nve-grid>
44+
<nve-grid-header>
45+
<nve-grid-column width="260px">File</nve-grid-column>
46+
<nve-grid-column>Description</nve-grid-column>
47+
</nve-grid-header>
48+
<nve-grid-row>
49+
<nve-grid-cell><code nve-text="code">dist/custom-elements.json</code></nve-grid-cell>
50+
<nve-grid-cell>The standard Custom Elements Manifest. This is the canonical component API metadata file.</nve-grid-cell>
51+
</nve-grid-row>
52+
<nve-grid-row>
53+
<nve-grid-cell><code nve-text="code">dist/data.html.json</code></nve-grid-cell>
54+
<nve-grid-cell>VS Code HTML custom data generated from the manifest. Editors use it for tag, attribute, hover, and reference information.</nve-grid-cell>
55+
</nve-grid-row>
56+
<nve-grid-row>
57+
<nve-grid-cell><code nve-text="code">dist/data.snippets.json</code></nve-grid-cell>
58+
<nve-grid-cell>Generated HTML snippets for faster component authoring.</nve-grid-cell>
59+
</nve-grid-row>
60+
<nve-grid-row>
61+
<nve-grid-cell><code nve-text="code">dist/custom-elements-jsx.d.ts</code></nve-grid-cell>
62+
<nve-grid-cell>Generated JSX intrinsic element types for JSX-based integrations such as Preact and SolidJS.</nve-grid-cell>
63+
</nve-grid-row>
64+
<nve-grid-row>
65+
<nve-grid-cell><code nve-text="code">dist/custom-elements-vue.d.ts</code></nve-grid-cell>
66+
<nve-grid-cell>Generated Vue template and JSX types where the package exposes Vue integration types.</nve-grid-cell>
67+
</nve-grid-row>
68+
</nve-grid>
69+
70+
The exact generated files vary by package. The `customElements` field is the stable signal that a package ships a CEM file.
71+
72+
## Tooling Enabled By CEM
73+
74+
### Editor Integration
75+
76+
VS Code can load custom HTML and CSS data through `html.customData`, `css.customData`, and extension contribution points. Elements converts CEM data into `data.html.json` so VS Code-compatible HTML language services can offer completions and hover docs for `nve-*` tags and attributes. The Elements project setup command writes the common Elements custom data paths into `.vscode/settings.json` for supported packages.
77+
78+
```json
79+
{
80+
"html.customData": [
81+
"./node_modules/@nvidia-elements/styles/dist/data.html.json",
82+
"./node_modules/@nvidia-elements/core/dist/data.html.json",
83+
"./node_modules/@nvidia-elements/monaco/dist/data.html.json",
84+
"./node_modules/@nvidia-elements/code/dist/data.html.json",
85+
"./node_modules/@nvidia-elements/markdown/dist/data.html.json"
86+
]
87+
}
88+
```
89+
90+
Some editors and extensions can consume CEM more directly. [WebComponents.dev](https://webcomponents.dev/docs/custom-elements-manifest) recognizes `custom-elements.json` and the `package.json#customElements` field. The [Custom Elements Manifest Language Server for Zed](https://zed.dev/extensions/cem) provides autocomplete and hover documentation from CEM data. The [Custom Element Language Server VS Code extension](https://open-vsx.org/extension/wc-toolkit/web-components-language-server) can find `customElements` fields and convert CEM into VS Code custom data.
91+
92+
### Framework Types
93+
94+
Elements uses CEM to generate type adapters for framework-specific authoring surfaces. The build uses `custom-element-jsx-integration` for JSX intrinsic element types and `custom-element-vuejs-integration` for Vue type declarations. These files help template and JSX tooling validate component names, attributes, properties, and events without requiring a framework-specific implementation of each component.
95+
96+
## References
97+
98+
- [Custom Elements Manifest specification](https://github.com/webcomponents/custom-elements-manifest)
99+
- [Custom Elements Manifest analyzer](https://custom-elements-manifest.open-wc.org/analyzer/getting-started/)
100+
- [VS Code custom data](https://github.com/microsoft/vscode-custom-data)
101+
- [WebComponents.dev CEM support](https://webcomponents.dev/docs/custom-elements-manifest)

0 commit comments

Comments
 (0)